From 4f5685d233d45be2c25f89e8cb2e3d0b30989b3e Mon Sep 17 00:00:00 2001 From: Rich Trott Date: Sun, 1 Dec 2019 02:59:36 -0800 Subject: [PATCH 1/2] 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(-) diff --git a/test/sequential/test-child-process-fork-getconnections.js b/test/sequential/test-child-process-fork-getconnections.js index 9a8f97c2bb2842..1b1ba9c0d96048 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); From 890d643b90efcb487bcabd62f3da3fdbd11bd62f Mon Sep 17 00:00:00 2001 From: Rich Trott Date: Sun, 1 Dec 2019 03:06:51 -0800 Subject: [PATCH 2/2] test: move test-child-process-fork-getconnections to parallel Now that the test uses an open port assigned by the operating system rather than a hardcoded common.PORT, it can be moved 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-child-process-fork-getconnections.js | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename test/{sequential => parallel}/test-child-process-fork-getconnections.js (100%) diff --git a/test/sequential/test-child-process-fork-getconnections.js b/test/parallel/test-child-process-fork-getconnections.js similarity index 100% rename from test/sequential/test-child-process-fork-getconnections.js rename to test/parallel/test-child-process-fork-getconnections.js