From a58ab9b8779855aafa0a1af533729a015eae31c3 Mon Sep 17 00:00:00 2001 From: Kendra Neil <53584728+TheRealAmazonKendra@users.noreply.github.com> Date: Thu, 30 May 2024 11:29:45 -0700 Subject: [PATCH] chore: only use 50% of workers for jest Jest is resource greedy so using all but one cores is actually slowing down the tests --- tools/@aws-cdk/cdk-build-tools/config/jest.config.js | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/tools/@aws-cdk/cdk-build-tools/config/jest.config.js b/tools/@aws-cdk/cdk-build-tools/config/jest.config.js index 9a93f61e642ba..80e8f52f53b2c 100644 --- a/tools/@aws-cdk/cdk-build-tools/config/jest.config.js +++ b/tools/@aws-cdk/cdk-build-tools/config/jest.config.js @@ -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: {