From 379c5cefd74728dbc6be8e3a780fc63c496bd0d8 Mon Sep 17 00:00:00 2001 From: Rich Trott Date: Mon, 7 Sep 2020 22:01:40 -0700 Subject: [PATCH] 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: https://github.com/nodejs/node/pull/35101 Reviewed-By: Bradley Farias Reviewed-By: Andrey Pechkurov --- test/pummel/test-policy-integrity.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/test/pummel/test-policy-integrity.js b/test/pummel/test-policy-integrity.js index 3965372ed84351..db1589c5ffe834 100644 --- a/test/pummel/test-policy-integrity.js +++ b/test/pummel/test-policy-integrity.js @@ -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 = []; { @@ -82,7 +84,7 @@ function queueSpawn(opts) { } function drainQueue() { - if (spawned > 50) { + if (spawned > cpus) { return; } if (toSpawn.length) { @@ -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); }