test: use random port in NodeInstance.startViaSignal()

Which makes it possible to run the tests that use this in parallel.

PR-URL: https://github.com/nodejs/node/pull/47412
Refs: https://github.com/nodejs/node/issues/47146
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
Reviewed-By: Moshe Atlow <moshe@atlow.co.il>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
pull/47414/head
Joyee Cheung 2023-04-05 01:18:30 +02:00 committed by Node.js GitHub Bot
parent 217830da9a
commit 5cc12c75c0
1 changed files with 1 additions and 1 deletions

View File

@ -372,7 +372,7 @@ class NodeInstance extends EventEmitter {
static async startViaSignal(scriptContents) { static async startViaSignal(scriptContents) {
const instance = new NodeInstance( const instance = new NodeInstance(
['--expose-internals'], ['--expose-internals', '--inspect-port=0'],
`${scriptContents}\nprocess._rawDebug('started');`, undefined); `${scriptContents}\nprocess._rawDebug('started');`, undefined);
const msg = 'Timed out waiting for process to start'; const msg = 'Timed out waiting for process to start';
while (await fires(instance.nextStderrString(), msg, TIMEOUT) !== 'started'); while (await fires(instance.nextStderrString(), msg, TIMEOUT) !== 'started');