Skip to content

Attempt to fix the hls eval plugin test suite #2299

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

Closed
wants to merge 3 commits into from

Conversation

pepeiborra
Copy link
Collaborator

@pepeiborra pepeiborra commented Oct 24, 2021

The test suite often fails with interactive eval errors like the one below:

GHC.ByteCode.Linker.lookupCE
During interactive linking, GHCi couldn't find the following symbol:
  interactive_Ghci1_evalPrint_closure

What does this error mean?

The GHC Session contains a mutable interactive context. During the Evaluate command, we first install a special "evalPrint" closure and then kick off the evaluation. These two steps are not atomic, and I think the error above means that the interactive context has been mutated in between those two steps.

What actions can mutate this interactive context? I'm not sure.

Who is mutating the GHC session? Since the GHC session is shared across the entire component, it could be any other build target.

But most tests only work with one module. Sure, but every test in this test suite reuses the test.cabal project with >20 modules. ghcide typechecks all the project modules at startup, and I don't think the tests wait for this initial typechecking to complete.

Result: the tests run the Eval command concurrently with the initial typechecking.

This PR disables the initial typechecking in this test suite, with the hope that the test suite will become less flaky.

It should use the default config settings for checkProject and checkParents
@pepeiborra pepeiborra force-pushed the fix-hls-eval-plugin-test-suite branch from 82517c8 to 1f6bcdf Compare October 24, 2021 16:02
@santiweight
Copy link
Collaborator

A heads up - I don't see any note of this in your commit message... I normally get this error when I click the refresh/evaluate code lenses and then click another while the initial code lens is still processing. Perhaps this is due to some concurrency?

@pepeiborra
Copy link
Collaborator Author

A heads up - I don't see any note of this in your commit message... I normally get this error when I click the refresh/evaluate code lenses and then click another while the initial code lens is still processing. Perhaps this is due to some concurrency?

It is mentioned in the PR description:

Result: the tests run the Eval command concurrently with the initial typechecking.

While this PR won't fix that issue in general, only in the testsuite, a recently landed PR should help: #2295

@pepeiborra
Copy link
Collaborator Author

Superseded by #2302 and #2303

@pepeiborra pepeiborra closed this Oct 25, 2021
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.

2 participants