Skip to content

Commit

Permalink
dns: try to fix test suite for CI
Browse files Browse the repository at this point in the history
PR-URL: #39987
Fixes: #31566
Refs: #6307
Refs: #20710
Refs: #38099
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Michael Dawson <midawson@redhat.com>
  • Loading branch information
treysis authored and nodejs-github-bot committed Sep 12, 2021
1 parent 68e8c9a commit 7b0b1ec
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions test/parallel/test-net-remote-address-port.js
Expand Up @@ -27,20 +27,17 @@ const net = require('net');

let conns_closed = 0;

const remoteAddrCandidates = [ common.localhostIPv4 ];
if (common.hasIPv6) remoteAddrCandidates.push('::1', '::ffff:127.0.0.1');
const remoteAddrCandidates = [ common.localhostIPv4,
'::1',
'::ffff:127.0.0.1' ];

const remoteFamilyCandidates = ['IPv4'];
if (common.hasIPv6) remoteFamilyCandidates.push('IPv6');
const remoteFamilyCandidates = ['IPv4', 'IPv6'];

const server = net.createServer(common.mustCall(function(socket) {
// REM: assert.match(socket.remoteAddress,
// REM: /^127\.0\.0\.1$|^::1$|^::ffff:127\.0\.0\.1$/);
assert.ok(remoteAddrCandidates.includes(socket.remoteAddress),
`Illformed remoteAddress: ${socket.remoteAddress}`);
assert.ok(remoteFamilyCandidates.includes(socket.remoteFamily),
`Illformed remoteFamily: ${socket.remoteFamily}`);
// REM: assert.ok(remoteFamilyCandidates.includes(socket.remoteFamily));
assert.ok(socket.remotePort);
assert.notStrictEqual(socket.remotePort, this.address().port);
socket.on('end', function() {
Expand Down

0 comments on commit 7b0b1ec

Please sign in to comment.