Skip to content

test: test-net-dns-error.js fails on SunOS - #31780

Closed
batrla wants to merge 2 commits into
nodejs:masterfrom
batrla:master
Closed

test: test-net-dns-error.js fails on SunOS#31780
batrla wants to merge 2 commits into
nodejs:masterfrom
batrla:master

Conversation

@batrla

Copy link
Copy Markdown
Contributor

Test test-net-dns-error.js causes assertion failure on SunOS,
test expects ENOTFOUND, but OS returns EAI_FAIL.

Maximum length of a host name is 63 characters. Test test-net-dns-error.js
makes a connection attempt to invalid host name (longer than maximum by 1).
Such connection attempt on SunOS returns permanent failure (EAI_FAIL)
as invalid hostname won't be ever resolved.

Checklist

Test test-net-dns-error.js causes assertion failure on SunOS,
test expects ENOTFOUND, but OS returns EAI_FAIL.
Maximum length of a host name is 63 characters. Test test-net-dns-error.js
makes a connection attempt to invalid host name (longer than maximum). Such
connection attempt on SunOS returns permanent failure (EAI_FAIL) as invalid
hostname won't be ever resolved.
@nodejs-github-botnodejs-github-bot added the test Issues and PRs related to the tests. label Feb 13, 2020
@addaleaxaddaleax added the author ready PRs that have at least one approval, no pending requests for changes, and a CI started. label Feb 16, 2020
@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

@batrla

Copy link
Copy Markdown
ContributorAuthor

Sorry, the suggested fix caused test regression in CI on SmartOS, where
the same test got ENOTFOUND instead of expected EAI_FAIL.
My testing was on Solaris 11.4 OS.

Test regression was either due to:

  • divergency between Solaris and SmartOS (both are being SunOS derivates)
  • difference in name services configuration on my machine and CI (perhaps
    nsswitch.conf(5) or resolv.conf(5))

I don't know exact cause. It seems to me it's not trivial to determine whether
the OS returns EAI_FAIL or ENOTFOUND. My proposal is to:

  • Allow both EAI_FAIL and ENOTFOUND in test-net-dns-error.js

    Let's assume that it is OS specific or resolver configuration specific
    whether the system actually returns EAI_FAIL or ENOTFOUND in response to
    attempt to resolve an illegal hostname using getaddrinfo(3C). EAI_FAIL
    indicates permanent failure:

    EAI_FAIL Non-recoverable failure in name resolution has occurred.

The proposal is dup of recent PR by @cjihrig in test-http-dns-error.js:
test: allow EAI_FAIL in test-http-dns-error.js #27500

@Trott

Copy link
Copy Markdown
Member
  • Allow both EAI_FAIL and ENOTFOUND in test-net-dns-error.js

Yes, I think that would be the thing to do.

@Trott

Copy link
Copy Markdown
Member
  • Allow both EAI_FAIL and ENOTFOUND in test-net-dns-error.js

Yes, I think that would be the thing to do.

You might also want to include a comment explaining why both are being allowed and linking to this pull request/discussion. Otherwise, someone might subsequently remove the allowance for EAI_FAIL (and CI will pass when they do).

@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

@batrla

Copy link
Copy Markdown
ContributorAuthor

You might also want to include a comment explaining why both are being allowed and linking to this pull request/discussion. Otherwise, someone might subsequently remove the allowance for EAI_FAIL (and CI will pass when they do).

I added following comment:

// Resolving hostname > 63 characters may return EAI_FAIL (permanent failure).

If the comment is insufficient, I'll be happy to make it more explicit next time the test breaks.

@Trott

Copy link
Copy Markdown
Member

If the comment is insufficient, I'll be happy to make it more explicit next time the test breaks.

That's good, but perhaps we should also mention specifically that it fails that way on SunOS and what version of SunOS? (This is just a suggestion though. I'm not blocking this from landing or anything.)

addaleax pushed a commit that referenced this pull request Mar 9, 2020
Test test-net-dns-error.js causes assertion failure on SunOS,
test expects ENOTFOUND, but OS returns EAI_FAIL.
Maximum length of a host name is 63 characters.
Test test-net-dns-error.js makes a connection attempt to
invalid host name (longer than maximum). Such
connection attempt on SunOS returns permanent failure
(EAI_FAIL) as invalid hostname won't be ever resolved.
PR-URL: #31780
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
@addaleax

Copy link
Copy Markdown
Member

Landed in 077f9dc

@addaleaxaddaleax closed this Mar 9, 2020
MylesBorins pushed a commit that referenced this pull request Mar 9, 2020
Test test-net-dns-error.js causes assertion failure on SunOS,
test expects ENOTFOUND, but OS returns EAI_FAIL.
Maximum length of a host name is 63 characters.
Test test-net-dns-error.js makes a connection attempt to
invalid host name (longer than maximum). Such
connection attempt on SunOS returns permanent failure
(EAI_FAIL) as invalid hostname won't be ever resolved.
PR-URL: #31780
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
@MylesBorinsMylesBorins mentioned this pull request Mar 10, 2020
codebytere pushed a commit that referenced this pull request Mar 17, 2020
Test test-net-dns-error.js causes assertion failure on SunOS,
test expects ENOTFOUND, but OS returns EAI_FAIL.
Maximum length of a host name is 63 characters.
Test test-net-dns-error.js makes a connection attempt to
invalid host name (longer than maximum). Such
connection attempt on SunOS returns permanent failure
(EAI_FAIL) as invalid hostname won't be ever resolved.
PR-URL: #31780
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
@codebyterecodebytere mentioned this pull request Mar 17, 2020
codebytere pushed a commit that referenced this pull request Mar 23, 2020
Test test-net-dns-error.js causes assertion failure on SunOS,
test expects ENOTFOUND, but OS returns EAI_FAIL.
Maximum length of a host name is 63 characters.
Test test-net-dns-error.js makes a connection attempt to
invalid host name (longer than maximum). Such
connection attempt on SunOS returns permanent failure
(EAI_FAIL) as invalid hostname won't be ever resolved.
PR-URL: #31780
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
codebytere pushed a commit that referenced this pull request Mar 30, 2020
Test test-net-dns-error.js causes assertion failure on SunOS,
test expects ENOTFOUND, but OS returns EAI_FAIL.
Maximum length of a host name is 63 characters.
Test test-net-dns-error.js makes a connection attempt to
invalid host name (longer than maximum). Such
connection attempt on SunOS returns permanent failure
(EAI_FAIL) as invalid hostname won't be ever resolved.
PR-URL: #31780
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

author readyPRs that have at least one approval, no pending requests for changes, and a CI started.testIssues and PRs related to the tests.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants

@batrla@nodejs-github-bot@Trott@addaleax@bnoordhuis@jasnell@lpinca@cjihrig