Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 287bdab

Browse filesBrowse files
committed
test: make test-net-connect-options-ipv6.js better
Improve the robustness of test-net-connect-options-ipv6.js PPC Suse build team encountered intermittent failures related to dns. Improve test to make it more robust in the face of intermittent dns issues. PR-URL: #5791 Reviewed-By: James M Snell <jasnell@gmail.com>
1 parent d3a7534 commit 287bdab
Copy full SHA for 287bdab

File tree

Expand file treeCollapse file tree

1 file changed

+15
-1
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

1 file changed

+15
-1
lines changed
Open diff view settings
Collapse file

‎test/parallel/test-net-connect-options-ipv6.js‎

Copy file name to clipboardExpand all lines: test/parallel/test-net-connect-options-ipv6.js
+15-1Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,21 @@ function tryConnect() {
4040
server.close();
4141
});
4242
}).on('error', function(err) {
43-
if (err.syscall === 'getaddrinfo' && err.code === 'ENOTFOUND') {
43+
// ENOTFOUND means we don't have the requested address. In this
44+
// case we try the next one in the list and if we run out of
45+
// candidates we assume IPv6 is not supported on the
46+
// machine and skip the test.
47+
// EAI_AGAIN means we tried to remotely resolve the address and
48+
// timed out or hit some intermittent connectivity issue with the
49+
// dns server. Although we are looking for local loopback addresses
50+
// we may go remote since the list we search includes addresses that
51+
// cover more than is available on any one distribution. The
52+
// net is that if we get an EAI_AGAIN we were looking for an
53+
// address which does not exist in this distribution so the error
54+
// is not significant and we should just move on and try the
55+
// next address in the list.
56+
if ((err.syscall === 'getaddrinfo') && ((err.code === 'ENOTFOUND') ||
57+
(err.code === 'EAI_AGAIN'))) {
4458
if (host !== 'localhost' || --localhostTries === 0)
4559
host = hosts[++hostIdx];
4660
if (host)

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.