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 integration test flakes in CI #4391

Merged
merged 3 commits into from
Oct 20, 2022

Conversation

the-mikedavis
Copy link
Member

Write path fixes (#2267) introduced some flaky behavior in the integration test suite that happens when running within GitHub Actions.

The Windows runner has clangd installed, but it sometimes takes too long to shutdown which causes false-positive test failures. All runners have the R binary installed but not the language server package. This causes a flake whenever tempfile::NamedTempFile creates a file which is mistaken as R (this happens surprisingly often in practice). The R binary starts but immediately crashes because the language server package is not installed. Then the language server cannot be shutdown in the expected timeframe, resulting in a false-positive failure.

Here I've removed all language server configuration for the integration tests by default with the ability to add back the configuration explicitly. This fixes the flakes as far as I've tested and silences some unnecessary output when running locally (from rust-analyzer).

I've also added some small fixes to...

`helix_view::apply_transaction` closes over `Document::apply` and
`View::apply` to ensure that jumplist entries are updated when a
document changes from a transaction. `Document::apply` shouldn't
be called directly - this helper function should be used instead.
This change removes language server configuration from the default
languages.toml config for integration tests. No integration-tests
currently depend on the availability of a language server but if any
future test needs to, it may provide a language server configuration
by passing an override into the `test_syntax_conf` helper.

Language-servers in integration tests cause false-positive failures
when running integration tests in GitHub Actions CI. The Windows
runner appears to have `clangd` installed and all OS runners have
the `R` binary installed but not the `R` language server package.
If a test file created by `tempfile::NamedTempFile` happens to have a
file extension of `r`, the test will most likely fail because the
R language server will fail to start and will become a broken pipe,
meaning that it will fail to shutdown within the timeout, causing a
false-positive failure. This happens surprisingly often in practice.

Language servers (especially rust-analyzer) also emit unnecessary
log output when initializing, which this change silences.
This function is not currently used but is likely to be useful in
the future, so this change silences the dead_code warning.
@archseer archseer merged commit 66238e8 into helix-editor:master Oct 20, 2022
@the-mikedavis the-mikedavis deleted the ci-flake-fixes branch October 20, 2022 23:51
@dead10ck
Copy link
Member

Thanks!

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.

3 participants