◐ Shell
clean mode source ↗

test: avoid flaky debugger restart waits · nodejs/node@604456c

Original file line numberDiff line numberDiff line change

@@ -25,7 +25,11 @@ const startCLI = require('../common/debugger');

2525

assert.strictEqual(cli.output.match(listeningRegExp).length, 1);

2626
2727

for (let i = 0; i < RESTARTS; i++) {

28-

await cli.stepCommand('restart');

28+

// For `restart`, sync on attach/prompt instead of BREAK_MESSAGE to avoid flaky races.

29+

// https://github.com/nodejs/node/issues/61762

30+

await cli.command('restart');

31+

await cli.waitFor(/Debugger attached\./);

32+

await cli.waitForPrompt();

2933

assert.strictEqual(cli.output.match(listeningRegExp).length, 1);

3034

}

3135

} finally {

Original file line numberDiff line numberDiff line change

@@ -57,7 +57,7 @@ const path = require('path');

5757

{ filename: script, line: 2 },

5858

);

5959

})

60-

.then(() => cli.stepCommand('restart'))

60+

.then(() => cli.command('restart'))

6161

.then(() => cli.waitForInitialBreak())

6262

.then(() => {

6363

assert.deepStrictEqual(