Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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]>
  • Loading branch information
Trott committed Sep 10, 2020
commit 7fc1a4a893e080d0e55d7af9638938d00889dc24
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);
}