Skip to content

Commit 814b8c3

Browse files
committed
test: handle IPv6 localhost issues within tests
The issue of hosts that do not resolve `localhost` to `::1` is now handled within the tests. Remove flaky status for test-https-connect-address-family and test-tls-connect-address-family. PR-URL: nodejs#7766 Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com> Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
1 parent 8c0f776 commit 814b8c3

File tree

3 files changed

+12
-9
lines changed

3 files changed

+12
-9
lines changed

test/parallel/parallel.status

-7
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,6 @@ test-tick-processor : PASS,FLAKY
1212
[$system==linux]
1313
test-tick-processor : PASS,FLAKY
1414

15-
# Flaky until https://github.com/nodejs/build/issues/415 is resolved.
16-
# On some of the buildbots, AAAA queries for localhost don't resolve
17-
# to an address and neither do any of the alternatives from the
18-
# localIPv6Hosts list from test/common.js.
19-
test-https-connect-address-family : PASS,FLAKY
20-
test-tls-connect-address-family : PASS,FLAKY
21-
2215
[$system==macos]
2316

2417
[$system==solaris] # Also applies to SmartOS

test/parallel/test-https-connect-address-family.js

+6-1
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,13 @@ function runTest() {
3636
}
3737

3838
dns.lookup('localhost', {family: 6, all: true}, (err, addresses) => {
39-
if (err)
39+
if (err) {
40+
if (err.code === 'ENOTFOUND') {
41+
common.skip('localhost does not resolve to ::1');
42+
return;
43+
}
4044
throw err;
45+
}
4146

4247
if (addresses.some((val) => val.address === '::1'))
4348
runTest();

test/parallel/test-tls-connect-address-family.js

+6-1
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,13 @@ function runTest() {
3535
}
3636

3737
dns.lookup('localhost', {family: 6, all: true}, (err, addresses) => {
38-
if (err)
38+
if (err) {
39+
if (err.code === 'ENOTFOUND') {
40+
common.skip('localhost does not resolve to ::1');
41+
return;
42+
}
3943
throw err;
44+
}
4045

4146
if (addresses.some((val) => val.address === '::1'))
4247
runTest();

0 commit comments

Comments
 (0)