From c386f7568cc2d6d7819687ba26d7b7bd78242c6d Mon Sep 17 00:00:00 2001 From: Rich Trott Date: Mon, 17 Feb 2020 18:29:38 -0800 Subject: [PATCH] test: remove common.PORT from test-net-write-callbacks.js Switch test-net-write-callbacks.js from common.PORT to a port assigned by the operating system. PR-URL: https://github.com/nodejs/node/pull/31839 Reviewed-By: Anna Henningsen Reviewed-By: Luigi Pinca Reviewed-By: Yongsheng Zhang Reviewed-By: James M Snell Reviewed-By: Colin Ihrig Reviewed-By: Shelley Vohr Reviewed-By: Richard Lau --- test/pummel/test-net-write-callbacks.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/test/pummel/test-net-write-callbacks.js b/test/pummel/test-net-write-callbacks.js index 0bcc9e2dec121a..cb011ab0022251 100644 --- a/test/pummel/test-net-write-callbacks.js +++ b/test/pummel/test-net-write-callbacks.js @@ -20,7 +20,7 @@ // USE OR OTHER DEALINGS IN THE SOFTWARE. 'use strict'; -const common = require('../common'); +require('../common'); const net = require('net'); const assert = require('assert'); @@ -55,8 +55,8 @@ function makeCallback(c) { }; } -server.listen(common.PORT, function() { - const client = net.createConnection(common.PORT); +server.listen(0, function() { + const client = net.createConnection(server.address().port); client.on('connect', function() { for (let i = 0; i < N; i++) {