Skip to content

Commit

Permalink
test: use dynamic port in 3 test-cluster-worker tests
Browse files Browse the repository at this point in the history
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]>
  • Loading branch information
Sebastian Plesciuc authored and evanlucas committed May 2, 2017
1 parent 3d8878c commit a34cccc
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion test/parallel/test-cluster-worker-disconnect.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down
2 changes: 1 addition & 1 deletion test/parallel/test-cluster-worker-exit.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {

Expand Down
2 changes: 1 addition & 1 deletion test/parallel/test-cluster-worker-kill.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {

Expand Down

0 comments on commit a34cccc

Please sign in to comment.