From 814b8c3cf796efa710ec1874ec4a30f7d50222cb Mon Sep 17 00:00:00 2001 From: Rich Trott Date: Sat, 16 Jul 2016 13:24:52 -0700 Subject: [PATCH] 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: https://github.com/nodejs/node/pull/7766 Reviewed-By: Sakthipriyan Vairamani Reviewed-By: Michael Dawson Reviewed-By: Ben Noordhuis --- test/parallel/parallel.status | 7 ------- test/parallel/test-https-connect-address-family.js | 7 ++++++- test/parallel/test-tls-connect-address-family.js | 7 ++++++- 3 files changed, 12 insertions(+), 9 deletions(-) diff --git a/test/parallel/parallel.status b/test/parallel/parallel.status index fc71d41657..88d0cb9465 100644 --- a/test/parallel/parallel.status +++ b/test/parallel/parallel.status @@ -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 diff --git a/test/parallel/test-https-connect-address-family.js b/test/parallel/test-https-connect-address-family.js index 21d0bf8dc6..ab13e060be 100644 --- a/test/parallel/test-https-connect-address-family.js +++ b/test/parallel/test-https-connect-address-family.js @@ -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(); diff --git a/test/parallel/test-tls-connect-address-family.js b/test/parallel/test-tls-connect-address-family.js index 6274328956..35216d91f6 100644 --- a/test/parallel/test-tls-connect-address-family.js +++ b/test/parallel/test-tls-connect-address-family.js @@ -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();