Skip to content

Commit

Permalink
test: use common.PORT instead of an extraneous variable
Browse files Browse the repository at this point in the history
This test is not parallelized and so we can use the test commons PORT
variable.

Refs: nodejs#27565 (comment)

PR-URL: nodejs#27565
Fixes: nodejs#27341
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
  • Loading branch information
Benjamin Ki authored and Trott committed May 13, 2019
1 parent 402a793 commit 7294897
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions test/internet/test-dgram-connect.js
Expand Up @@ -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);
}));

0 comments on commit 7294897

Please sign in to comment.