Skip to content

Commit

Permalink
chore: only use 50% of workers for jest
Browse files Browse the repository at this point in the history
Jest is resource greedy so using all but one cores is actually slowing down the tests
  • Loading branch information
TheRealAmazonKendra committed May 30, 2024
1 parent 81a558f commit a58ab9b
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions tools/@aws-cdk/cdk-build-tools/config/jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,8 @@ module.exports = {
},
],
},

// Limit workers to a reasonable fixed number. If we scale in the number of available CPUs, we will explode
// our memory limit on the CodeBuild instance that has 72 CPUs.
maxWorkers: Math.min(8, cpus().length - 1),

// Jest is resource greedy so this shouldn't be more than 50%
maxWorkers: '50%',
testEnvironment: 'node',
coverageThreshold: {
global: {
Expand Down

0 comments on commit a58ab9b

Please sign in to comment.