diff options
author | Sebastian Plesciuc <sebastian.plesciuc@sendgrid.com> | 2017-04-22 13:07:30 +0300 |
---|---|---|
committer | James M Snell <jasnell@gmail.com> | 2017-04-24 10:25:46 -0700 |
commit | 0105e6f826ff823522fa292899608001f8833b08 (patch) | |
tree | 694ac245d7da9a08324e25954c55f1d2b6ab08c4 /test/parallel/test-cluster-message.js | |
parent | 549e81bfa1028b3072c0eb78cacddceb662e2d43 (diff) | |
download | android-node-v8-0105e6f826ff823522fa292899608001f8833b08.tar.gz android-node-v8-0105e6f826ff823522fa292899608001f8833b08.tar.bz2 android-node-v8-0105e6f826ff823522fa292899608001f8833b08.zip |
test: dynamic port in parallel cluster tests
Removed common.PORT from test-cluster-message,
test-cluster-server-restart-none, test-cluster-server-restart-rr
and test-cluster-shared-handle-bind-error to eliminate the
possibility that a dynamic port used in another test will collide
with common.PORT.
PR-URL: https://github.com/nodejs/node/pull/12584
Ref: https://github.com/nodejs/node/issues/12376
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com>
Diffstat (limited to 'test/parallel/test-cluster-message.js')
-rw-r--r-- | test/parallel/test-cluster-message.js | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/test/parallel/test-cluster-message.js b/test/parallel/test-cluster-message.js index 7d1cef780f..ee7100185a 100644 --- a/test/parallel/test-cluster-message.js +++ b/test/parallel/test-cluster-message.js @@ -20,7 +20,7 @@ // USE OR OTHER DEALINGS IN THE SOFTWARE. 'use strict'; -const common = require('../common'); +require('../common'); const assert = require('assert'); const cluster = require('cluster'); const net = require('net'); @@ -60,7 +60,7 @@ if (cluster.isWorker) { maybeReply(); }); - server.listen(common.PORT, '127.0.0.1'); + server.listen(0, '127.0.0.1'); } else if (cluster.isMaster) { const checks = { @@ -109,9 +109,9 @@ if (cluster.isWorker) { }); // When a TCP server is listening in the worker connect to it - worker.on('listening', function() { + worker.on('listening', function(address) { - client = net.connect(common.PORT, function() { + client = net.connect(address.port, function() { // Send message to worker. worker.send('message from master'); }); |