Skip to content

Commit cd17314

Browse files
treysisnodejs-github-bot
authored andcommitted
dns: fix test suite part 2
PR-URL: #39987 Fixes: #31566 Refs: #6307 Refs: #20710 Refs: #38099 Reviewed-By: Antoine du Hamel <[email protected]> Reviewed-By: Matteo Collina <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Michael Dawson <[email protected]>
1 parent 9da76fd commit cd17314

14 files changed

+16
-12
lines changed

test/parallel/test-http-localaddress.js

+1
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ const server = http.createServer((req, res) => {
4242
server.listen(0, '127.0.0.1', () => {
4343
const options = { host: 'localhost',
4444
port: server.address().port,
45+
family: 4,
4546
path: '/',
4647
method: 'GET',
4748
localAddress: '127.0.0.2' };

test/parallel/test-http-upgrade-client.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ const server = net.createServer(function(c) {
4949
});
5050
});
5151

52-
server.listen(0, '127.0.0.1', common.mustCall(function() {
52+
server.listen(0, common.mustCall(function() {
5353
const port = this.address().port;
5454
const headers = [
5555
{

test/parallel/test-http2-connect-options.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ const server = http2.createServer((req, res) => {
2222
});
2323

2424
server.listen(0, '127.0.0.1', common.mustCall(() => {
25-
const options = { localAddress: '127.0.0.2' };
25+
const options = { localAddress: '127.0.0.2', family: 4 };
2626

2727
const client = http2.connect(
2828
'http://localhost:' + server.address().port,

test/parallel/test-https-localaddress.js

+1
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ server.listen(0, '127.0.0.1', function() {
5252
const options = {
5353
host: 'localhost',
5454
port: this.address().port,
55+
family: 4,
5556
path: '/',
5657
method: 'GET',
5758
localAddress: '127.0.0.2',

test/parallel/test-net-dns-lookup.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ const server = net.createServer(function(client) {
2929
server.close();
3030
});
3131

32-
server.listen(0, '127.0.0.1', common.mustCall(function() {
32+
server.listen(0, common.mustCall(function() {
3333
net.connect(this.address().port, 'localhost')
3434
.on('lookup', common.mustCall(function(err, ip, type, host) {
3535
assert.strictEqual(err, null);

test/parallel/test-net-remote-address-port.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,8 @@ const server = net.createServer(common.mustCall(function(socket) {
4848
socket.resume();
4949
}, 2));
5050

51-
server.listen(0, 'localhost', function() {
52-
const client = net.createConnection(this.address().port, 'localhost');
51+
server.listen(0, function() {
52+
const client = net.createConnection(this.address().port, '127.0.0.1');
5353
const client2 = net.createConnection(this.address().port);
5454
client.on('connect', function() {
5555
assert.ok(remoteAddrCandidates.includes(client.remoteAddress));

test/parallel/test-tcp-wrap-listen.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ const {
1414

1515
const server = new TCP(TCPConstants.SOCKET);
1616

17-
const r = server.bind('0.0.0.0', 0);
17+
const r = server.bind(0);
1818
assert.strictEqual(r, 0);
1919
let port = {};
2020
server.getsockname(port);

test/parallel/test-timers-socket-timeout-removes-other-socket-unref-timer.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ const server = net.createServer(function onClient(client) {
2828
}
2929
});
3030

31-
server.listen(0, common.localhostIPv4, common.mustCall(() => {
31+
server.listen(0, common.mustCall(() => {
3232
const countdown = new Countdown(2, () => server.close());
3333

3434
{

test/parallel/test-tls-client-getephemeralkeyinfo.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ function test(size, type, name, cipher) {
3737

3838
server.on('close', common.mustSucceed());
3939

40-
server.listen(0, '127.0.0.1', common.mustCall(() => {
40+
server.listen(0, common.mustCall(() => {
4141
const client = tls.connect({
4242
port: server.address().port,
4343
rejectUnauthorized: false

test/parallel/test-tls-client-mindhsize.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ function test(size, err, next) {
3434
if (next) next();
3535
});
3636

37-
server.listen(0, '127.0.0.1', function() {
37+
server.listen(0, function() {
3838
// Client set minimum DH parameter size to 2048 bits so that
3939
// it fails when it make a connection to the tls server where
4040
// dhparams is 1024 bits

test/parallel/test-tls-wrap-econnreset-localaddress.js

+1
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ const server = net.createServer((c) => {
1616
let errored = false;
1717
tls.connect({
1818
port: port,
19+
family: 4,
1920
localAddress: common.localhostIPv4
2021
}, common.localhostIPv4)
2122
.once('error', common.mustCall((e) => {

test/pummel/test-http-upload-timeout.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ server.on('request', function(req, res) {
4444
req.resume();
4545
});
4646

47-
server.listen(0, '127.0.0.1', function() {
47+
server.listen(0, function() {
4848
for (let i = 0; i < 10; i++) {
4949
connections++;
5050

test/pummel/test-net-pingpong.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,8 @@ function pingPongTest(host, on_complete) {
3838
if (host === '127.0.0.1') {
3939
assert.strictEqual(address, '127.0.0.1');
4040
} else if (host == null || host === 'localhost') {
41-
assert(address === '127.0.0.1' || address === '::ffff:127.0.0.1');
41+
assert(address === '127.0.0.1' || address === '::ffff:127.0.0.1'
42+
|| address === '::1');
4243
} else {
4344
console.log(`host = ${host}, remoteAddress = ${address}`);
4445
assert.strictEqual(address, '::1');

test/sequential/test-inspector-open.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ function reopenAfterClose(msg) {
8080
}
8181

8282
function ping(port, callback) {
83-
net.connect(port)
83+
net.connect({ port, family: 4 })
8484
.on('connect', function() { close(this); })
8585
.on('error', function(err) { close(this, err); });
8686

0 commit comments

Comments
 (0)