diff --git a/test/parallel/test-cluster-worker-disconnect.js b/test/parallel/test-cluster-worker-disconnect.js index be7ce2b3bf78a9..0554671fea3b61 100644 --- a/test/parallel/test-cluster-worker-disconnect.js +++ b/test/parallel/test-cluster-worker-disconnect.js @@ -28,7 +28,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 5d3df98f3b989e..db8835abe40b15 100644 --- a/test/parallel/test-cluster-worker-exit.js +++ b/test/parallel/test-cluster-worker-exit.js @@ -40,7 +40,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 311128f1b896c5..ad06ff097896f9 100644 --- a/test/parallel/test-cluster-worker-kill.js +++ b/test/parallel/test-cluster-worker-kill.js @@ -36,7 +36,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) {