Repository navigation
chore: cap Jest workers and skip type-checking per worker - #345
Merged
Merged
Conversation
Jest defaulted to one worker per core, each type-checking with ts-jest. On 32 cores that took about 33 GB and froze a development machine. With 25% of the cores and isolatedModules, the suite peaks at 3.7 GB instead of 8.7 GB at the same worker count, and runs 11 s instead of 16 s. CI keeps type-checking through yarn typecheck. 🤖 Generated with Claude Code
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.
yarn teststarted one Jest worker per core, each type-checking through ts-jest at about 1.1 GB.On a 32-core machine that adds up to about 33 GB and froze it.
This caps the workers at 25% of the cores and skips type-checking in the workers, which
yarn typecheckalready covers in CI.Peak memory of the suite, measured in a cgroup with 8 workers: 8.7 GB → 3.7 GB, 16 s → 11 s.
For agents 🤖: ready for review once CI passes
Measured with
systemd-run --user --scope -p MemoryMax=12Gand the scope'smemory.peak, the old config run with--maxWorkers=8.All 25 suites and 204 tests pass with the new config.