Skip to content

Commit 2519757

Browse files
Sebastian Plesciucjasnell
authored andcommitted
test: use dynamic port in 3 test-cluster-worker tests
Remove common.PORT from test-cluster-worker-disconnect, test-cluster-worker-exit and test-cluster-worker-kill to eliminate the possibility that a dynamic port used in another test will collide with common.PORT. PR-URL: #12443 Ref: #12376 Reviewed-By: Benjamin Gruenbaum <[email protected]> Reviewed-By: Gibson Fahnestock <[email protected]> Reviewed-By: Santiago Gimeno <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: James M Snell <[email protected]>
1 parent def78e8 commit 2519757

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

test/parallel/test-cluster-worker-disconnect.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ if (cluster.isWorker) {
2828
const http = require('http');
2929
http.Server(() => {
3030

31-
}).listen(common.PORT, '127.0.0.1');
31+
}).listen(0, '127.0.0.1');
3232
const worker = cluster.worker;
3333
assert.strictEqual(worker.exitedAfterDisconnect, worker.suicide);
3434

test/parallel/test-cluster-worker-exit.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ if (cluster.isWorker) {
4040
server.once('listening', common.mustCall(() => {
4141
process.exit(EXIT_CODE);
4242
}));
43-
server.listen(common.PORT, '127.0.0.1');
43+
server.listen(0, '127.0.0.1');
4444

4545
} else if (cluster.isMaster) {
4646

test/parallel/test-cluster-worker-kill.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ if (cluster.isWorker) {
3636
const server = http.Server(() => { });
3737

3838
server.once('listening', common.mustCall(() => { }));
39-
server.listen(common.PORT, '127.0.0.1');
39+
server.listen(0, '127.0.0.1');
4040

4141
} else if (cluster.isMaster) {
4242

0 commit comments

Comments
 (0)