Skip to content
Prev Previous commit
cluster: const numWorkers added in test-inspect-support-for-node_options
const numWorkers added to specify number of workers spawned
in test-inspect-support-for-node_options. PR #19165

Fixes : #19026
  • Loading branch information
sameer-coder committed Mar 17, 2018
commit 907b8ff18b9c916961bd38cf484178ad7c401ccc
5 changes: 3 additions & 2 deletions test/parallel/test-inspect-support-for-node_options.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,11 @@ checkForInspectSupport('--inspect');
function checkForInspectSupport(flag) {

const nodeOptions = JSON.stringify(flag);
const numWorkers = 2;
process.env.NODE_OPTIONS = flag;

if (cluster.isMaster) {
for (let i = 0; i < 2; i++) {
for (let i = 0; i < numWorkers; i++) {
cluster.fork();
}

Expand All @@ -24,6 +25,6 @@ function checkForInspectSupport(flag) {
cluster.on('exit', common.mustCall((worker, code, signal) => {
const errMsg = `For NODE_OPTIONS ${nodeOptions}, failed to start cluster`;
assert.strictEqual(worker.exitedAfterDisconnect, true, errMsg);
}, 2));
}, numWorkers));
}
}