Skip to content

Commit d8d1995

Browse files
Trottgibfahn
authored andcommitted
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(). PR-URL: #17466 Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Jon Moss <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Michael Dawson <[email protected]> Reviewed-By: Ruben Bridgewater <[email protected]>
1 parent e68f86b commit d8d1995

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

test/common/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -537,7 +537,7 @@ function _mustCallInner(fn, criteria = 1, field) {
537537
exports.hasMultiLocalhost = function hasMultiLocalhost() {
538538
const TCP = process.binding('tcp_wrap').TCP;
539539
const t = new TCP();
540-
const ret = t.bind('127.0.0.2', exports.PORT);
540+
const ret = t.bind('127.0.0.2', 0);
541541
t.close();
542542
return ret === 0;
543543
};

0 commit comments

Comments
 (0)