Переглянути джерело

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 <[email protected]>
Co-authored-by: Eric Wheeler <[email protected]>
KJ7LNW 8 місяців тому
батько
коміт
da2ab6e388
2 змінених файлів з 2 додано та 2 видалено
  1. 1 1
      package.json
  2. 1 1
      webview-ui/package.json

+ 1 - 1
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",

+ 1 - 1
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",