test: replace Map with Array in cluster-net-listen tests

PR-URL: https://github.com/nodejs/node/pull/32381
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
This commit is contained in:
Rich Trott
2020-03-18 06:16:18 -07:00
parent 1d49558273
commit 7d4dedbf6a
2 changed files with 4 additions and 4 deletions

View File

@@ -16,7 +16,7 @@ const host = '::';
const WORKER_ACCOUNT = 3;
if (cluster.isMaster) {
const workers = new Map();
const workers = [];
const countdown = new Countdown(WORKER_ACCOUNT, () => {
// Make sure the `ipv6Only` option works. This is the part of the test that
@@ -46,7 +46,7 @@ if (cluster.isMaster) {
countdown.dec();
}));
workers.set(i, worker);
workers[i] = worker;
}
} else {
net.createServer().listen({

View File

@@ -16,7 +16,7 @@ const host = '::';
const WORKER_ACCOUNT = 3;
if (cluster.isMaster) {
const workers = new Map();
const workers = [];
let address;
const countdown = new Countdown(WORKER_ACCOUNT, () => {
@@ -45,7 +45,7 @@ if (cluster.isMaster) {
countdown.dec();
}));
workers.set(i, worker);
workers[i] = worker;
}
} else {
// As the cluster member has the potential to grab any port