Skip to content

Commit 39e2fb6

Browse files
TrottMylesBorins
authored andcommitted
test: simplify common.PORT code
common.PORT is no longer used in parallelized tests and should not be. Remove code that accommodates parallelized tests. PR-URL: #17559 Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Gibson Fahnestock <[email protected]>
1 parent f7a1e39 commit 39e2fb6

File tree

2 files changed

+3
-6
lines changed

2 files changed

+3
-6
lines changed

test/common/index.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,9 @@ const noop = () => {};
3939
// Using a `.` prefixed name, which is the convention for "hidden" on POSIX,
4040
// gets tools to ignore it by default or by simple rules, especially eslint.
4141
let tmpDirName = '.tmp';
42-
// PORT should match the definition in test/testpy/__init__.py.
42+
4343
exports.PORT = +process.env.NODE_COMMON_PORT || 12346;
44+
4445
exports.isWindows = process.platform === 'win32';
4546
exports.isWOW64 = exports.isWindows &&
4647
(process.env.PROCESSOR_ARCHITEW6432 !== undefined);
@@ -162,7 +163,6 @@ exports.refreshTmpDir = function() {
162163
};
163164

164165
if (process.env.TEST_THREAD_ID) {
165-
exports.PORT += process.env.TEST_THREAD_ID * 100;
166166
tmpDirName += `.${process.env.TEST_THREAD_ID}`;
167167
}
168168
exports.tmpDir = path.join(testRoot, tmpDirName);

test/testpy/__init__.py

+1-4
Original file line numberDiff line numberDiff line change
@@ -61,10 +61,7 @@ def GetCommand(self):
6161
source = open(self.file).read()
6262
flags_match = FLAGS_PATTERN.search(source)
6363
if flags_match:
64-
# PORT should match the definition in test/common/index.js.
65-
env = { 'PORT': int(os.getenv('NODE_COMMON_PORT', '12346')) }
66-
env['PORT'] += self.thread_id * 100
67-
flag = flags_match.group(1).strip().format(**env).split()
64+
flag = flags_match.group(1).strip().split()
6865
# The following block reads config.gypi to extract the v8_enable_inspector
6966
# value. This is done to check if the inspector is disabled in which case
7067
# the '--inspect' flag cannot be passed to the node process as it will

0 commit comments

Comments
 (0)