Skip to content

Commit

Permalink
test: handle IPv6 localhost issues within tests
Browse files Browse the repository at this point in the history
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 <thechargingvolcano@gmail.com>
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
  • Loading branch information
Trott committed Jul 20, 2016
1 parent 8c0f776 commit 814b8c3
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 9 deletions.
7 changes: 0 additions & 7 deletions test/parallel/parallel.status
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,6 @@ test-tick-processor : PASS,FLAKY
[$system==linux]
test-tick-processor : PASS,FLAKY

# Flaky until https://github.com/nodejs/build/issues/415 is resolved.
# On some of the buildbots, AAAA queries for localhost don't resolve
# to an address and neither do any of the alternatives from the
# localIPv6Hosts list from test/common.js.
test-https-connect-address-family : PASS,FLAKY
test-tls-connect-address-family : PASS,FLAKY

[$system==macos]

[$system==solaris] # Also applies to SmartOS
Expand Down
7 changes: 6 additions & 1 deletion test/parallel/test-https-connect-address-family.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,13 @@ function runTest() {
}

dns.lookup('localhost', {family: 6, all: true}, (err, addresses) => {
if (err)
if (err) {
if (err.code === 'ENOTFOUND') {
common.skip('localhost does not resolve to ::1');
return;
}
throw err;
}

if (addresses.some((val) => val.address === '::1'))
runTest();
Expand Down
7 changes: 6 additions & 1 deletion test/parallel/test-tls-connect-address-family.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,13 @@ function runTest() {
}

dns.lookup('localhost', {family: 6, all: true}, (err, addresses) => {
if (err)
if (err) {
if (err.code === 'ENOTFOUND') {
common.skip('localhost does not resolve to ::1');
return;
}
throw err;
}

if (addresses.some((val) => val.address === '::1'))
runTest();
Expand Down

0 comments on commit 814b8c3

Please sign in to comment.