Skip to content
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
dns: try to fix test suite for CI
  • Loading branch information
treysis committed Sep 5, 2021
commit 431f7b23776af84d1faa0e39a97e6607a7166d2e
11 changes: 4 additions & 7 deletions test/parallel/test-net-remote-address-port.js
Original file line number Diff line number Diff line change
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