Skip to content
Permalink
Browse files

test: dynamic port in cluster worker wait close

Remove common.PORT from test-cluster-worker-wait-server-close
possibility that a dynamic port used in another test will collide
with common.PORT.

PR-URL: #12466
Ref: #12376
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com>
  • Loading branch information...
Sebastian Plesciuc authored and jasnell committed Apr 17, 2017
1 parent 9c5c469 commit 86a3ba0c4eb4b5226e805d1bc496b567be2e5664
Showing with 3 additions and 3 deletions.
  1. +3 −3 test/parallel/test-cluster-worker-wait-server-close.js
@@ -12,7 +12,7 @@ if (cluster.isWorker) {
// Wait for any data, then close connection
socket.write('.');
socket.on('data', common.noop);
}).listen(common.PORT, common.localhostIPv4);
}).listen(0, common.localhostIPv4);

server.once('close', function() {
serverClosed = true;
@@ -33,8 +33,8 @@ if (cluster.isWorker) {
const worker = cluster.fork();

// Disconnect worker when it is ready
worker.once('listening', function() {
const socket = net.createConnection(common.PORT, common.localhostIPv4);
worker.once('listening', function(address) {
const socket = net.createConnection(address.port, common.localhostIPv4);

socket.on('connect', function() {
socket.on('data', function() {

0 comments on commit 86a3ba0

Please sign in to comment.
You can’t perform that action at this time.