summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorRich Trott <rtrott@gmail.com>2020-09-07 22:01:40 -0700
committerRich Trott <rtrott@gmail.com>2020-09-10 06:09:23 -0700
commit7fc1a4a893e080d0e55d7af9638938d00889dc24 (patch)
tree6a2829fcaac11d748f3283f79f0012ff81116c4b /test
parenta03e15f571dc54455896489589504df7ce45a0c8 (diff)
downloadnode-new-7fc1a4a893e080d0e55d7af9638938d00889dc24.tar.gz
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 <bradley.meck@gmail.com> Reviewed-By: Andrey Pechkurov <apechkurov@gmail.com>
Diffstat (limited to 'test')
-rw-r--r--test/pummel/test-policy-integrity.js5
1 files changed, 3 insertions, 2 deletions
diff --git a/test/pummel/test-policy-integrity.js b/test/pummel/test-policy-integrity.js
index 3965372ed8..db1589c5ff 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);
}