Skip to content

Commit a34cccc

Browse files
Sebastian Plesciucevanlucas
Sebastian Plesciuc
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 3d8878c commit a34cccc

3 files changed

+3
-3
lines changed

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ if (cluster.isWorker) {
77
const http = require('http');
88
http.Server(() => {
99

10-
}).listen(common.PORT, '127.0.0.1');
10+
}).listen(0, '127.0.0.1');
1111
const worker = cluster.worker;
1212
assert.strictEqual(worker.exitedAfterDisconnect, worker.suicide);
1313

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ if (cluster.isWorker) {
1919
server.once('listening', common.mustCall(() => {
2020
process.exit(EXIT_CODE);
2121
}));
22-
server.listen(common.PORT, '127.0.0.1');
22+
server.listen(0, '127.0.0.1');
2323

2424
} else if (cluster.isMaster) {
2525

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ if (cluster.isWorker) {
1515
const server = http.Server(() => { });
1616

1717
server.once('listening', common.mustCall(() => { }));
18-
server.listen(common.PORT, '127.0.0.1');
18+
server.listen(0, '127.0.0.1');
1919

2020
} else if (cluster.isMaster) {
2121

0 commit comments

Comments
 (0)