WIP: Run ghcide-tests in parallel - #4977
Draft
crtschin wants to merge 18 commits into
Draft
Conversation
crtschin
force-pushed
the
crtschin/parallel-tests
branch
4 times, most recently
from
June 16, 2026 22:51
20959b4 to
5e1ca4d
Compare
tasty defaulted to `numProcessors` while each in-process server set its RTS capabilities to `numProcessors / 2`. Drive both from a single variable so test concurrency and capabilities agree.
Pre-initialise the RTS object linker once before tasty forks workers, so concurrent in-process sessions don't race their initialization.
crtschin
force-pushed
the
crtschin/parallel-tests
branch
from
June 19, 2026 23:08
8eddf5c to
f75d737
Compare
theophile-scrive
left a comment
There was a problem hiding this comment.
Here are some initial comments. :)
| initObjLinker RetainCAFs | ||
| _ <- pure $! length originalWorkingDirectory -- force before tasty forks workers | ||
| defaultMainWithIngredients ingredientsWithRerun | ||
| (localOption n (wrapCliTestOptions (adjustOption (const $ mkTimeout 600000000) tree))) |
There was a problem hiding this comment.
Doesn't localOption override the CLI parameters?
|
|
||
| - if: needs.pre_job.outputs.should_skip_ghcide != 'true' && matrix.test | ||
| name: Test ghcide | ||
| # run the tests without parallelism to avoid running out of memory |
There was a problem hiding this comment.
Is this comment still relevant?
| testNumThreads = unsafePerformIO $ do | ||
| override <- lookupEnv "GHCIDE_TEST_THREADS" | ||
| np <- getNumProcessors | ||
| pure $ maybe (max 1 (np `div` 2)) read override |
There was a problem hiding this comment.
I don't think read gives any actionable advice to correct the argument if it fails parsing.
| -- Pre-initialise the RTS object linker once, single-threaded, before tasty | ||
| -- forks workers, so concurrent sessions do not race linker initialization. | ||
| initObjLinker RetainCAFs | ||
| _ <- pure $! length originalWorkingDirectory -- force before tasty forks workers |
There was a problem hiding this comment.
I think you can use the more idiomatic
Suggested change
| _ <- pure $! length originalWorkingDirectory -- force before tasty forks workers | |
| evaluate originalWorkingDirectory -- force before tasty forks workers |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Trying something out.