Skip to content

WIP: Run ghcide-tests in parallel - #4977

Draft
crtschin wants to merge 18 commits into
haskell:masterfrom
crtschin:crtschin/parallel-tests
Draft

WIP: Run ghcide-tests in parallel#4977
crtschin wants to merge 18 commits into
haskell:masterfrom
crtschin:crtschin/parallel-tests

Conversation

@crtschin

Copy link
Copy Markdown
Collaborator

Trying something out.

@crtschin
crtschin force-pushed the crtschin/parallel-tests branch 4 times, most recently from 20959b4 to 5e1ca4d Compare June 16, 2026 22:51
@crtschin
crtschin force-pushed the crtschin/parallel-tests branch from 8eddf5c to f75d737 Compare June 19, 2026 23:08

@theophile-scrive theophile-scrive left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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)))

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this comment still relevant?

testNumThreads = unsafePerformIO $ do
override <- lookupEnv "GHCIDE_TEST_THREADS"
np <- getNumProcessors
pure $ maybe (max 1 (np `div` 2)) read override

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

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