From 10d01c305a216ba759b256f844ff41c4fdd2668c Mon Sep 17 00:00:00 2001 From: Eric Wheeler Date: Tue, 15 Apr 2025 12:13:14 -0700 Subject: [PATCH] test: limit Jest worker count to 40% per suite - 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 --- package.json | 2 +- webview-ui/package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 2a8244b25ce..8f347b9314b 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 5dd9f999e36..8267a7e918c 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",