Skip to content

Commit 64b5b0e

Browse files
committed
test: avoid flaky restart sync in debugger exceptions test
1 parent e78ccd8 commit 64b5b0e

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

test/parallel/test-debugger-exceptions.js

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,9 @@ const path = require('path');
2727
await cli.waitFor(/disconnect/);
2828

2929
// Next run: With `breakOnException` it pauses in both places.
30-
await cli.stepCommand('r');
30+
await cli.command('r');
31+
await cli.waitFor(/Debugger attached\./);
32+
await cli.waitForPrompt();
3133
await cli.waitForInitialBreak();
3234
assert.deepStrictEqual(cli.breakInfo, { filename: script, line: 1 });
3335
await cli.command('breakOnException');
@@ -38,15 +40,19 @@ const path = require('path');
3840

3941
// Next run: With `breakOnUncaught` it only pauses on the 2nd exception.
4042
await cli.command('breakOnUncaught');
41-
await cli.stepCommand('r'); // Also, the setting survives the restart.
43+
await cli.command('r'); // Also, the setting survives the restart.
44+
await cli.waitFor(/Debugger attached\./);
45+
await cli.waitForPrompt();
4246
await cli.waitForInitialBreak();
4347
assert.deepStrictEqual(cli.breakInfo, { filename: script, line: 1 });
4448
await cli.stepCommand('c');
4549
assert.ok(cli.output.includes(`exception in ${script}:9`));
4650

4751
// Next run: Back to the initial state! It should die again.
4852
await cli.command('breakOnNone');
49-
await cli.stepCommand('r');
53+
await cli.command('r');
54+
await cli.waitFor(/Debugger attached\./);
55+
await cli.waitForPrompt();
5056
await cli.waitForInitialBreak();
5157
assert.deepStrictEqual(cli.breakInfo, { filename: script, line: 1 });
5258
await cli.command('c');

0 commit comments

Comments
 (0)