Skip to content

chore: cap Jest workers and skip type-checking per worker - #345

Merged
spawnia merged 1 commit into
masterfrom
cap-jest-workers
Nov 9, 2026
Merged

spawnia merged 1 commit into
masterfrom
cap-jest-workers

Conversation

@spawnia

@spawnia spawnia commented Nov 9, 2026 •

Copy link
Copy Markdown
Member

yarn test started 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 typecheck already 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=12G and the scope's memory.peak, the old config run with --maxWorkers=8.
All 25 suites and 204 tests pass with the new config.

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
@spawnia
spawnia marked this pull request as ready for review November 9, 2026 15:53
@spawnia
spawnia merged commit 7f94e48 into master Nov 9, 2026
8 checks passed
@spawnia
spawnia deleted the cap-jest-workers branch November 9, 2026 15:54
@github-actions

Copy link
Copy Markdown

🎉 This PR is included in version 21.1.1 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Development

Successfully merging this pull request may close these issues.

1 participant