diff --git a/test/parallel/test-cluster-worker-disconnect.js b/test/parallel/test-cluster-worker-disconnect.js index 684fd5541eac55..c2f7e611876d9d 100644 --- a/test/parallel/test-cluster-worker-disconnect.js +++ b/test/parallel/test-cluster-worker-disconnect.js @@ -7,7 +7,7 @@ if (cluster.isWorker) { const http = require('http'); http.Server(() => { - }).listen(common.PORT, '127.0.0.1'); + }).listen(0, '127.0.0.1'); const worker = cluster.worker; assert.strictEqual(worker.exitedAfterDisconnect, worker.suicide); diff --git a/test/parallel/test-cluster-worker-exit.js b/test/parallel/test-cluster-worker-exit.js index 1cd7b1d0f222c7..8f1eceaf9e66ac 100644 --- a/test/parallel/test-cluster-worker-exit.js +++ b/test/parallel/test-cluster-worker-exit.js @@ -19,7 +19,7 @@ if (cluster.isWorker) { server.once('listening', common.mustCall(() => { process.exit(EXIT_CODE); })); - server.listen(common.PORT, '127.0.0.1'); + server.listen(0, '127.0.0.1'); } else if (cluster.isMaster) { diff --git a/test/parallel/test-cluster-worker-kill.js b/test/parallel/test-cluster-worker-kill.js index 834cd62bc06916..050f61ed47b4b7 100644 --- a/test/parallel/test-cluster-worker-kill.js +++ b/test/parallel/test-cluster-worker-kill.js @@ -15,7 +15,7 @@ if (cluster.isWorker) { const server = http.Server(() => { }); server.once('listening', common.mustCall(() => { })); - server.listen(common.PORT, '127.0.0.1'); + server.listen(0, '127.0.0.1'); } else if (cluster.isMaster) {