diff options
author | Rich Trott <rtrott@gmail.com> | 2019-12-01 02:59:36 -0800 |
---|---|---|
committer | Rich Trott <rtrott@gmail.com> | 2019-12-03 03:36:17 -0800 |
commit | 4f5685d233d45be2c25f89e8cb2e3d0b30989b3e (patch) | |
tree | b56a0389287867ef3218fa41560cd0854e6a67ff /test | |
parent | 415bba752ffcdc28ccae6cdf567e739be77ad6f9 (diff) | |
download | android-node-v8-4f5685d233d45be2c25f89e8cb2e3d0b30989b3e.tar.gz android-node-v8-4f5685d233d45be2c25f89e8cb2e3d0b30989b3e.tar.bz2 android-node-v8-4f5685d233d45be2c25f89e8cb2e3d0b30989b3e.zip |
test: change common.PORT to arbitrary port
Change common.PORT to arbitrary port in
test-child-process-fork-getconnections to prepare for moving that test
from sequential to parallel.
PR-URL: https://github.com/nodejs/node/pull/30749
Reviewed-By: Denys Otrishko <shishugi@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Diffstat (limited to 'test')
-rw-r--r-- | test/sequential/test-child-process-fork-getconnections.js | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/test/sequential/test-child-process-fork-getconnections.js b/test/sequential/test-child-process-fork-getconnections.js index 9a8f97c2bb..1b1ba9c0d9 100644 --- a/test/sequential/test-child-process-fork-getconnections.js +++ b/test/sequential/test-child-process-fork-getconnections.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 fork = require('child_process').fork; const net = require('net'); @@ -79,7 +79,7 @@ if (process.argv[2] === 'child') { server.on('listening', function() { let j = count; while (j--) { - const client = net.connect(common.PORT, '127.0.0.1'); + const client = net.connect(server.address().port, '127.0.0.1'); client.on('close', function() { disconnected += 1; }); @@ -110,7 +110,7 @@ if (process.argv[2] === 'child') { closeEmitted = true; }); - server.listen(common.PORT, '127.0.0.1'); + server.listen(0, '127.0.0.1'); process.on('exit', function() { assert.strictEqual(sent, count); |