Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit fe9d9f7

Browse filesBrowse files
TrottMylesBorins
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 <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>
1 parent f7b0054 commit fe9d9f7
Copy full SHA for fe9d9f7

File tree

Expand file treeCollapse file tree

1 file changed

+1
-1
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

1 file changed

+1
-1
lines changed
Open diff view settings
Collapse file

‎test/common/index.js‎

Copy file name to clipboardExpand all lines: test/common/index.js
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -526,7 +526,7 @@ function _mustCallInner(fn, criteria = 1, field) {
526526
exports.hasMultiLocalhost = function hasMultiLocalhost() {
527527
const { TCP, constants: TCPConstants } = process.binding('tcp_wrap');
528528
const t = new TCP(TCPConstants.SOCKET);
529-
const ret = t.bind('127.0.0.2', exports.PORT);
529+
const ret = t.bind('127.0.0.2', 0);
530530
t.close();
531531
return ret === 0;
532532
};

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.