diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 7f1b8c4a151..3f8e6df8db4 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -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 }} diff --git a/jest.config.js b/jest.config.js index 5ff8a84f923..aa066e745be 100644 --- a/jest.config.js +++ b/jest.config.js @@ -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", }; diff --git a/libs/shared/jest.config.ts.js b/libs/shared/jest.config.ts.js index b558a86611f..e801202642e 100644 --- a/libs/shared/jest.config.ts.js +++ b/libs/shared/jest.config.ts.js @@ -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: ["/../../libs/shared/polyfill-node-globals.ts"],