diff options
author | Sebastian Plesciuc <sebastian.plesciuc@sendgrid.com> | 2017-04-18 18:20:31 +0300 |
---|---|---|
committer | Rich Trott <rtrott@gmail.com> | 2017-04-22 22:38:50 -0700 |
commit | cf68280ce1c6f9ee13e4b85a05832993b7e1a3d3 (patch) | |
tree | 31a36ddcd4af9393e1b3aedd78a863922da3f11d /test/parallel/test-cluster-dgram-1.js | |
parent | bd97e48d9a761885005e06d5f6373ae62363b093 (diff) | |
download | android-node-v8-cf68280ce1c6f9ee13e4b85a05832993b7e1a3d3.tar.gz android-node-v8-cf68280ce1c6f9ee13e4b85a05832993b7e1a3d3.tar.bz2 android-node-v8-cf68280ce1c6f9ee13e4b85a05832993b7e1a3d3.zip |
test: dynamic port in cluster worker dgram
Remove common.PORT from test-cluster-dgram-1 and
test-cluster-dgram-2, in order to eliminate the
possibility of port collision.
PR-URL: https://github.com/nodejs/node/pull/12487
Ref: https://github.com/nodejs/node/issues/12376
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com>
Diffstat (limited to 'test/parallel/test-cluster-dgram-1.js')
-rw-r--r-- | test/parallel/test-cluster-dgram-1.js | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/test/parallel/test-cluster-dgram-1.js b/test/parallel/test-cluster-dgram-1.js index 96474c53ff..65335225bf 100644 --- a/test/parallel/test-cluster-dgram-1.js +++ b/test/parallel/test-cluster-dgram-1.js @@ -49,7 +49,7 @@ function master() { cluster.fork(); // Wait until all workers are listening. - cluster.on('listening', common.mustCall(() => { + cluster.on('listening', common.mustCall((worker, address) => { if (++listening < NUM_WORKERS) return; @@ -60,7 +60,7 @@ function master() { doSend(); function doSend() { - socket.send(buf, 0, buf.length, common.PORT, '127.0.0.1', afterSend); + socket.send(buf, 0, buf.length, address.port, address.address, afterSend); } function afterSend() { @@ -111,5 +111,5 @@ function worker() { } }, PACKETS_PER_WORKER)); - socket.bind(common.PORT); + socket.bind(0); } |