Skip to content

test: don't connect to :: (use localhost instead)

If a test does http.listen(0) or net.listen(0), http.listen(0).address().address returns '::'. Some machines will resolve this to localhost, but not all. Every machine should have localhost defined in /etc/hosts (or equivalent), so it should always resolve.

Fixes: https://github.com/nodejs/node/issues/7291

Fixed

Checklist
  • make -j4 test (UNIX), or vcbuild test (Windows) passes
  • tests and/or benchmarks are included
  • commit message follows commit guidelines
Affected core subsystem(s)

test

cc/ @cjihrig in reply to https://github.com/nodejs/node/pull/9572#discussion_r87693222, you can't use server.address().address.

cc/ @nodejs/testing

Merge request reports

Loading