[v6.x backport] test: remove hidden use of common.PORT in parallel tests
Backport of https://github.com/nodejs/node/pull/17466
common.hasMultiLocalhost() uses common.PORT under the hood. This is problematic in parallel tests because another test using port 0 to get an arbitrary open port may end up getting common.PORT before the test using common.PORT gets it.
Therefore, change common.PORT to port 0 in common.hasMultiLocalhost().
PR-URL: https://github.com/nodejs/node/pull/17466 Reviewed-By: Luigi Pinca luigipinca@gmail.com Reviewed-By: Colin Ihrig cjihrig@gmail.com Reviewed-By: Jon Moss me@jonathanmoss.me Reviewed-By: James M Snell jasnell@gmail.com Reviewed-By: Michael Dawson michael_dawson@ca.ibm.com Reviewed-By: Ruben Bridgewater ruben@bridgewater.de
Checklist
-
make -j4 test
(UNIX), orvcbuild test
(Windows) passes -
commit message follows commit guidelines
Affected core subsystem(s)
test