Skip to content

Commit c94f3a5

Browse files
TrottMylesBorins
authored andcommitted
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: #7766 Reviewed-By: Sakthipriyan Vairamani <[email protected]> Reviewed-By: Michael Dawson <[email protected]> Reviewed-By: Ben Noordhuis <[email protected]>
1 parent b64828d commit c94f3a5

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
@@ -32,8 +32,13 @@ function runTest() {
3232
}
3333

3434
dns.lookup('localhost', {family: 6, all: true}, (err, addresses) => {
35-
if (err)
35+
if (err) {
36+
if (err.code === 'ENOTFOUND') {
37+
common.skip('localhost does not resolve to ::1');
38+
return;
39+
}
3640
throw err;
41+
}
3742

3843
if (addresses.some((val) => val.address === '::1'))
3944
runTest();

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

+6-1
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,13 @@ function runTest() {
3131
}
3232

3333
dns.lookup('localhost', {family: 6, all: true}, (err, addresses) => {
34-
if (err)
34+
if (err) {
35+
if (err.code === 'ENOTFOUND') {
36+
common.skip('localhost does not resolve to ::1');
37+
return;
38+
}
3539
throw err;
40+
}
3641

3742
if (addresses.some((val) => val.address === '::1'))
3843
runTest();

0 commit comments

Comments
 (0)