@jsenv/test 3.0.2 → 3.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -5889,6 +5889,16 @@ const executeTestPlan = async ({
5889
5889
  `parallel.maxMemory must be a number or a percentage, got ${maxMemory}`,
5890
5890
  );
5891
5891
  }
5892
+
5893
+ const maxCpu = parallel.maxCpu;
5894
+ if (typeof maxCpu === "string") {
5895
+ const maxCpuAsRatio = assertPercentageAndConvertToRatio(maxCpu);
5896
+ parallel.maxCpu = maxCpuAsRatio;
5897
+ } else if (typeof maxCpu !== "number") {
5898
+ throw new TypeError(
5899
+ `parallel.maxCpu must be a number or a percentage, got ${maxCpu}`,
5900
+ );
5901
+ }
5892
5902
  }
5893
5903
  // testPlan
5894
5904
  {
@@ -6424,6 +6434,7 @@ To fix this warning:
6424
6434
  promises.push(promise);
6425
6435
  }
6426
6436
 
6437
+ console.log(cpuUsage.overall.active, parallel.maxCpu);
6427
6438
  if (cpuUsage.overall.active > parallel.maxCpu) {
6428
6439
  // retry after Xms in case cpu usage decreases
6429
6440
  const promise = (async () => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jsenv/test",
3
- "version": "3.0.2",
3
+ "version": "3.0.3",
4
4
  "license": "MIT",
5
5
  "repository": {
6
6
  "type": "git",
@@ -308,6 +308,16 @@ export const executeTestPlan = async ({
308
308
  `parallel.maxMemory must be a number or a percentage, got ${maxMemory}`,
309
309
  );
310
310
  }
311
+
312
+ const maxCpu = parallel.maxCpu;
313
+ if (typeof maxCpu === "string") {
314
+ const maxCpuAsRatio = assertPercentageAndConvertToRatio(maxCpu);
315
+ parallel.maxCpu = maxCpuAsRatio;
316
+ } else if (typeof maxCpu !== "number") {
317
+ throw new TypeError(
318
+ `parallel.maxCpu must be a number or a percentage, got ${maxCpu}`,
319
+ );
320
+ }
311
321
  }
312
322
  // testPlan
313
323
  {
@@ -843,6 +853,7 @@ To fix this warning:
843
853
  promises.push(promise);
844
854
  }
845
855
 
856
+ console.log(cpuUsage.overall.active, parallel.maxCpu);
846
857
  if (cpuUsage.overall.active > parallel.maxCpu) {
847
858
  // retry after Xms in case cpu usage decreases
848
859
  const promise = (async () => {