From da2ab6e3882b547461a4a2c07034c6994afd500e Mon Sep 17 00:00:00 2001 From: KJ7LNW <93454819+KJ7LNW@users.noreply.github.com> Date: Tue, 15 Apr 2025 14:37:27 -0700 Subject: [PATCH] test: limit Jest worker count to 40% per suite (#2658) - Each test suite (extension/webview) limited to 40% CPU usage - Total CPU utilization capped at 80% (40% x 2 suites) - Reserves 20% CPU for system and user tasks - Prevents memory thrashing and system slowdown - Reduces risk of OOM kills on memory-constrained systems - Maintains smooth UI responsiveness during test runs - Improves test reliability while keeping parallel execution Signed-off-by: Eric Wheeler Co-authored-by: Eric Wheeler --- package.json | 2 +- webview-ui/package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 2a8244b25c..8f347b9314 100644 --- a/package.json +++ b/package.json @@ -370,7 +370,7 @@ "pretest": "npm run compile", "dev": "cd webview-ui && npm run dev", "test": "node scripts/run-tests.js", - "test:extension": "jest", + "test:extension": "jest -w=40%", "test:webview": "cd webview-ui && npm run test", "prepare": "husky", "publish:marketplace": "vsce publish && ovsx publish", diff --git a/webview-ui/package.json b/webview-ui/package.json index 5dd9f999e3..8267a7e918 100644 --- a/webview-ui/package.json +++ b/webview-ui/package.json @@ -7,7 +7,7 @@ "lint": "eslint src/**/*.ts src/**/*.tsx", "lint-fix": "eslint src/**/*.ts src/**/*.tsx --fix", "check-types": "tsc", - "test": "jest", + "test": "jest -w=40%", "dev": "vite", "tsc": "tsc -b", "vite-build": "vite build",