Skip to content

Commit

Permalink
chore: only use 50% of workers for jest (aws#30393)
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

### Issue # (if applicable)

Closes #<issue number here>.

### Reason for this change



### Description of changes



### Description of how you validated changes



### Checklist
- [ ] My code adheres to the [CONTRIBUTING GUIDE](https://github.com/aws/aws-cdk/blob/main/CONTRIBUTING.md) and [DESIGN GUIDELINES](https://github.com/aws/aws-cdk/blob/main/docs/DESIGN_GUIDELINES.md)

----

*By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
  • Loading branch information
TheRealAmazonKendra authored and Dahlberg Victor committed Jun 10, 2024
1 parent 0ecc8b3 commit 6f32daa
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 6f32daa

Please sign in to comment.