From 9ed5882dec1995fe5024386eed3334cd37850058 Mon Sep 17 00:00:00 2001 From: Benjamin Ki Date: Sat, 4 May 2019 21:28:32 -0400 Subject: [PATCH] test: use common.PORT instead of an extraneous variable This test is not parallelized and so we can use the test commons PORT variable. Refs: https://github.com/nodejs/node/pull/27565#discussion_r281000162 PR-URL: https://github.com/nodejs/node/pull/27565 Fixes: https://github.com/nodejs/node/issues/27341 Reviewed-By: Rich Trott Reviewed-By: James M Snell Reviewed-By: Ruben Bridgewater --- test/internet/test-dgram-connect.js | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/test/internet/test-dgram-connect.js b/test/internet/test-dgram-connect.js index 785181cee6bed3..47a12c7890924c 100644 --- a/test/internet/test-dgram-connect.js +++ b/test/internet/test-dgram-connect.js @@ -5,17 +5,15 @@ const { addresses } = require('../common/internet'); const assert = require('assert'); const dgram = require('dgram'); -const PORT = 12345; - const client = dgram.createSocket('udp4'); -client.connect(PORT, addresses.INVALID_HOST, common.mustCall((err) => { +client.connect(common.PORT, addresses.INVALID_HOST, common.mustCall((err) => { assert.ok(err.code === 'ENOTFOUND' || err.code === 'EAI_AGAIN'); client.once('error', common.mustCall((err) => { assert.ok(err.code === 'ENOTFOUND' || err.code === 'EAI_AGAIN'); client.once('connect', common.mustCall(() => client.close())); - client.connect(PORT); + client.connect(common.PORT); })); - client.connect(PORT, addresses.INVALID_HOST); + client.connect(common.PORT, addresses.INVALID_HOST); }));