test: mock dns lookup function in parallel tests#17296
test: mock dns lookup function in parallel tests#17296joyeecheung wants to merge 2 commits intonodejs:masterfrom
Conversation
These tests should not make any DNS calls. The lookup would fail when the DNS requests are hijacked and time out instead of erroring out.
|
These failures happened to me again when I was on the hotel wifi. We should just mock the requests. |
I totally agree with that. |
Generally agree, but I'm 👍 on mocks/test doubles being D.R.Y. |
Trott
left a comment
There was a problem hiding this comment.
LGTM. If it's easy/quick enough to do, it might be worth comparing a coverage run with and without these changes to see if this loses anything in terms of coverage of the lib/dns.js code.
|
@Trott I think if the coverage decreases we would need to write other tests for that (or it would be ideal if we can run the internet tests on the coverage machine & a testing CI job). |
|
node-test-commit-linux-linked failed but didn't look related...trying a new one: https://ci.nodejs.org/job/node-test-commit-linux-linked/374/ |
PR-URL: #17296 Refs: nodejs/help#687 Reviewed-By: Refael Ackermann <refack@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
These tests should not make any DNS calls. The lookup would fail when the DNS requests are hijacked and time out instead of erroring out. PR-URL: #17296 Refs: nodejs/help#687 Reviewed-By: Refael Ackermann <refack@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
PR-URL: #17296 Refs: nodejs/help#687 Reviewed-By: Refael Ackermann <refack@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
These tests should not make any DNS calls. The lookup would fail when the DNS requests are hijacked and time out instead of erroring out. PR-URL: #17296 Refs: nodejs/help#687 Reviewed-By: Refael Ackermann <refack@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
PR-URL: #17296 Refs: nodejs/help#687 Reviewed-By: Refael Ackermann <refack@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
These tests should not make any DNS calls. The lookup would fail when the DNS requests are hijacked and time out instead of erroring out. PR-URL: #17296 Refs: nodejs/help#687 Reviewed-By: Refael Ackermann <refack@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
PR-URL: #17296 Refs: nodejs/help#687 Reviewed-By: Refael Ackermann <refack@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
These tests should not make any DNS calls. The lookup would fail when the DNS requests are hijacked and time out instead of erroring out. PR-URL: #17296 Refs: nodejs/help#687 Reviewed-By: Refael Ackermann <refack@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
|
Should this be backported to |
PR-URL: nodejs#17296 Refs: nodejs/help#687 Reviewed-By: Refael Ackermann <refack@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
These tests should not make any DNS calls. The lookup would fail when the DNS requests are hijacked and time out instead of erroring out. PR-URL: nodejs#17296 Refs: nodejs/help#687 Reviewed-By: Refael Ackermann <refack@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
PR-URL: #17296 Backport-PR-URL: #19706 Refs: nodejs/help#687 Reviewed-By: Refael Ackermann <refack@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
These tests should not make any DNS calls. The lookup would fail when the DNS requests are hijacked and time out instead of erroring out. PR-URL: #17296 Backport-PR-URL: #19706 Refs: nodejs/help#687 Reviewed-By: Refael Ackermann <refack@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
Checklist
make -j4 test(UNIX), orvcbuild test(Windows) passesAffected core subsystem(s)
test
These tests should not make any DNS calls. The lookup would fail when the DNS requests are hijacked and time out instead of erroring out.
Refs: nodejs/help#687
Refs: #14781 (comment)