[BEEEP] [PM-37492] Make jest tests faster

This commit is contained in:
Bernd Schoolmann 2026-06-02 04:34:04 +09:00 committed by GitHub
parent d24baa04b5
commit 7574d3859b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 5 additions and 3 deletions

View File

@ -119,7 +119,7 @@ jobs:
# maxWorkers is a workaround for a memory leak that crashes tests in CI:
# https://github.com/facebook/jest/issues/9430#issuecomment-1149882002
# Reduced to 2 workers and split tests across parallel jobs to prevent OOM kills
run: npm test -- ${{ matrix.test-group.paths }} --coverage --maxWorkers=2
run: npm test -- ${{ matrix.test-group.paths }} --coverage --maxWorkers=2 --workerIdleMemoryLimit=1500MiB
env:
JEST_JUNIT_OUTPUT_NAME: ${{ matrix.test-group.junit }}

View File

@ -71,5 +71,6 @@ module.exports = {
// Workaround for a memory leak that crashes tests in CI:
// https://github.com/facebook/jest/issues/9430#issuecomment-1149882002
// Also anecdotally improves performance when run locally
maxWorkers: 3,
maxWorkers: 8,
workerIdleMemoryLimit: "1500MiB",
};

View File

@ -7,7 +7,8 @@ module.exports = {
// Workaround for a memory leak that crashes tests in CI:
// https://github.com/facebook/jest/issues/9430#issuecomment-1149882002
// Also anecdotally improves performance when run locally
maxWorkers: 3,
maxWorkers: 8,
workerIdleMemoryLimit: "1500MiB",
setupFiles: ["<rootDir>/../../libs/shared/polyfill-node-globals.ts"],