From b702c149c6b488676e2250b90ae95a4b4857505e Mon Sep 17 00:00:00 2001 From: Rich Trott Date: Tue, 11 Feb 2020 19:23:51 -0800 Subject: [PATCH] test: remove common.PORT from test-net-pause MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Switch test-net-pause from common.PORT to a port assigned by the operating system. PR-URL: https://github.com/nodejs/node/pull/31749 Reviewed-By: Denys Otrishko Reviewed-By: Tobias Nießen Reviewed-By: Luigi Pinca Reviewed-By: James M Snell Reviewed-By: Anna Henningsen Reviewed-By: Ruben Bridgewater --- test/pummel/test-net-pause.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/test/pummel/test-net-pause.js b/test/pummel/test-net-pause.js index 512d833ae75717..76237c17214d23 100644 --- a/test/pummel/test-net-pause.js +++ b/test/pummel/test-net-pause.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 net = require('net'); @@ -43,7 +43,7 @@ const server = net.createServer((connection) => { }); server.on('listening', () => { - const client = net.createConnection(common.PORT); + const client = net.createConnection(server.address().port); client.setEncoding('ascii'); client.on('data', (d) => { console.log(d); @@ -83,7 +83,7 @@ server.on('listening', () => { client.end(); }); }); -server.listen(common.PORT); +server.listen(0); process.on('exit', () => { assert.strictEqual(recv.length, N);