diff options
author | Michael Dawson <michael_dawson@ca.ibm.com> | 2019-04-04 13:03:48 -0400 |
---|---|---|
committer | Michael Dawson <michael_dawson@ca.ibm.com> | 2019-04-08 12:17:48 -0400 |
commit | f96a6608eb63f4c6710c9c2078916655e32cf003 (patch) | |
tree | a8462c98747433e4024f627e8aaef6689bc94a39 /test/parallel/test-worker-memory.js | |
parent | 93df0853866bbdf40cc5877ac893e2fae1479d39 (diff) | |
download | android-node-v8-f96a6608eb63f4c6710c9c2078916655e32cf003.tar.gz android-node-v8-f96a6608eb63f4c6710c9c2078916655e32cf003.tar.bz2 android-node-v8-f96a6608eb63f4c6710c9c2078916655e32cf003.zip |
test: fix test-worker-memory.js for large cpu #s
This test consistently failed on a system with a
large number of cores (~120). Cap the number of
concurrent workers so we'll stay consistently within
the "slack" allowed with respect to rss.
PR-URL: https://github.com/nodejs/node/pull/27090
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
Diffstat (limited to 'test/parallel/test-worker-memory.js')
-rw-r--r-- | test/parallel/test-worker-memory.js | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/test/parallel/test-worker-memory.js b/test/parallel/test-worker-memory.js index 56b06858dd..db204244a5 100644 --- a/test/parallel/test-worker-memory.js +++ b/test/parallel/test-worker-memory.js @@ -4,7 +4,13 @@ const assert = require('assert'); const util = require('util'); const { Worker } = require('worker_threads'); -const numWorkers = +process.env.JOBS || require('os').cpus().length; +let numWorkers = +process.env.JOBS || require('os').cpus().length; +if (numWorkers > 20) { + // Cap the number of workers at 20 (as an even divisor of 60 used as + // the total number of workers started) otherwise the test fails on + // machines with high core counts. + numWorkers = 20; +} // Verify that a Worker's memory isn't kept in memory after the thread finishes. |