Skip to content

Commit 379c5ce

Browse files
Trottruyadorno
authored andcommitted
test: revise test-policy-integrity
* eliminate unneeded Set deletion/cleanup * use number of CPUs as limit for processes spawned rather than hard-coding the limit PR-URL: #35101 Reviewed-By: Bradley Farias <[email protected]> Reviewed-By: Andrey Pechkurov <[email protected]>
1 parent 93e4d54 commit 379c5ce

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

test/pummel/test-policy-integrity.js

+3-2
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ const fs = require('fs');
1313
const path = require('path');
1414
const { pathToFileURL } = require('url');
1515

16+
const cpus = require('os').cpus().length;
17+
1618
function hash(algo, body) {
1719
const values = [];
1820
{
@@ -82,7 +84,7 @@ function queueSpawn(opts) {
8284
}
8385

8486
function drainQueue() {
85-
if (spawned > 50) {
87+
if (spawned > cpus) {
8688
return;
8789
}
8890
if (toSpawn.length) {
@@ -383,6 +385,5 @@ debug(`spawning ${tests.size} policy integrity permutations`);
383385

384386
for (const config of tests) {
385387
const parsed = JSON.parse(config);
386-
tests.delete(config);
387388
queueSpawn(parsed);
388389
}

0 commit comments

Comments
 (0)