From 4f5685d233d45be2c25f89e8cb2e3d0b30989b3e Mon Sep 17 00:00:00 2001 From: Rich Trott Date: Sun, 1 Dec 2019 02:59:36 -0800 Subject: 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 Reviewed-By: James M Snell Reviewed-By: Ruben Bridgewater --- test/sequential/test-child-process-fork-getconnections.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'test') 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); -- cgit v1.2.3