Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix continue-on-error behavior in GitHub Actions #286

Merged
merged 2 commits into from
Jun 12, 2021

Conversation

ebkalderon
Copy link
Owner

@ebkalderon ebkalderon commented Jun 12, 2021

Fixed

  • Coerce matrix.continue-on-error to bool in the rust.yml workflow. Should fix the erroneous behavior seen in Support null and negative integer request IDs #285 during the macOS builds. See the first commit message for details.
  • Switch all tests to #[tokio::test(flavor = "current_thread")] to fix failing macOS test jobs in CI.

Since the `matrix.continue-on-error` setting is only ever defined for
nightly Rust build jobs, all other jobs will trigger a CI error if they
fail:

```
Error: Process completed with exit code 101.
Error: .github/workflows/rust.yml (Line: 31, Col: 26): Unexpected value ''
Error: The step failed and an error occurred when attempting to determine whether to continue on error.
Error: The template is not valid. .github/workflows/rust.yml (Line: 31, Col: 26): Unexpected value ''
```

The output above indicates that `matrix.continue-on-error` defaults to
an empty string if it's not explicitly defined for the current job in
the matrix. The `continue-on-error: ${{ matrix.continue-on-error }}`
evaluation then fails due to expecting a `bool` value.

I've tried specifying a default value of `continue-on-error: [false]` in
the matrix, but attempting to override this default setting using
`include` just creates more build jobs with `continue-on-error: true`
instead of overriding the setting for the existing ones, which isn't
what we want.

The solution I found was to append `|| false` to the end, which coerces
the type to `false` if the setting is undefined for the current job.
This suppresses the error message and produces the original expected
behavior.
@ebkalderon ebkalderon self-assigned this Jun 12, 2021
@ebkalderon ebkalderon force-pushed the fix-continue-on-error-github-actions branch from accd724 to 8f0e510 Compare June 12, 2021 21:26
@ebkalderon
Copy link
Owner Author

ebkalderon commented Jun 12, 2021

Seems there are some spurious errors occurring lately in the { os: macOS-latest, rust-version: beta } builds. I've noticed them occurring in #285 as well. 😕

Error: thread 'service::tests::initializes_only_once' panicked at 'called `Result::unwrap()` on an `Err` value: Os { code: 22, kind: InvalidInput, message: "Invalid argument" }', src/service.rs:196:66

As far as I can tell from the logs, this seems like a platform and toolchain-specific IO issue. I think we should temporarily disable this job for the time being.

At least matrix.continue-on-error seems to be behaving as expected now!

@ebkalderon ebkalderon force-pushed the fix-continue-on-error-github-actions branch 3 times, most recently from 38ececf to 2d874ef Compare June 12, 2021 21:54
There seem to be some spurious I/O errors on macOS beta toolchain builds
lately which are causing error messages similar to the one below to
display during test runs:

```
Error: thread 'service::tests::initializes_only_once' panicked at 'called `Result::unwrap()` on an `Err` value: Os { code: 22, kind: InvalidInput, message: "Invalid argument" }', src/service.rs:196:66
```

Likewise, 1.52.1 stable appears to be affected as well.

It seems that switching to `#[tokio::test(flavor = "current_thread")]`
everywhere resolves these issues, so perhaps there is a regression in
`tokio` somewhere on macOS? At least this unblocks CI.
@ebkalderon ebkalderon force-pushed the fix-continue-on-error-github-actions branch from 2d874ef to 851ffc2 Compare June 12, 2021 22:01
@ebkalderon
Copy link
Owner Author

Nope, it seems that Rust 1.52.1 stable on macOS is affected by this issue as well, so these don't appear to be transient errors. I've found that switching all the test cases over to #[tokio::test(flavor = "current_thread")] miraculously fixes the problems on macOS. I wonder if there is a platform-specific regression inside tokio on macOS specifically? Seems odd that no other platform has run into this.

@ebkalderon ebkalderon merged commit 0c09c2b into master Jun 12, 2021
@ebkalderon ebkalderon deleted the fix-continue-on-error-github-actions branch June 12, 2021 22:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant