mirror of
https://github.com/nodejs/node.git
synced 2026-11-24 21:50:36 -05:00
test: remove hidden use of common.PORT in parallel tests
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(). Backport-PR-URL: https://github.com/nodejs/node/pull/17771 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>
This commit is contained in:
1 parent
b1b975370f
commit
a528d573ce
1 file changed
+1
-1
@@ -466,7 +466,7 @@ function _mustCallInner(fn, criteria, field) {
|
||||
exports.hasMultiLocalhost = function hasMultiLocalhost() {
|
||||
const TCP = process.binding('tcp_wrap').TCP;
|
||||
const t = new TCP();
|
||||
const ret = t.bind('127.0.0.2', exports.PORT);
|
||||
const ret = t.bind('127.0.0.2', 0);
|
||||
t.close();
|
||||
return ret === 0;
|
||||
};
|
||||
|
||||
Reference in new issue
Block a user