Skip to content

Commit

Permalink
test: revise test-policy-integrity
Browse files Browse the repository at this point in the history
* eliminate unneeded Set deletion/cleanup
* use number of CPUs as limit for processes spawned rather than
  hard-coding the limit

PR-URL: nodejs#35101
Reviewed-By: Bradley Farias <[email protected]>
Reviewed-By: Andrey Pechkurov <[email protected]>
  • Loading branch information
Trott authored and joesepi committed Oct 22, 2020
1 parent 2a30f6c commit e859c80
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions test/pummel/test-policy-integrity.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ const fs = require('fs');
const path = require('path');
const { pathToFileURL } = require('url');

const cpus = require('os').cpus().length;

function hash(algo, body) {
const values = [];
{
Expand Down Expand Up @@ -82,7 +84,7 @@ function queueSpawn(opts) {
}

function drainQueue() {
if (spawned > 50) {
if (spawned > cpus) {
return;
}
if (toSpawn.length) {
Expand Down Expand Up @@ -383,6 +385,5 @@ debug(`spawning ${tests.size} policy integrity permutations`);

for (const config of tests) {
const parsed = JSON.parse(config);
tests.delete(config);
queueSpawn(parsed);
}

0 comments on commit e859c80

Please sign in to comment.