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 <roo-code@z.ewheeler.org>
Co-authored-by: Eric Wheeler <roo-code@z.ewheeler.org>
This commit is contained in:
KJ7LNW 2025-04-15 14:37:27 -07:00 committed by GitHub
parent 1bbfd2e8e6
commit da2ab6e388
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 2 additions and 2 deletions

View file

@ -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",

View file

@ -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",