Skip to content

Commit 014e1f0

Browse files
inoway46aduh95
authored andcommitted
test: avoid flaky restart sync in debugger exceptions test
Signed-off-by: inoway46 <inoueyuya416@gmail.com> PR-URL: #62055 Refs: #61762 Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Gürgün Dayıoğlu <hey@gurgun.day>
1 parent dd28ff8 commit 014e1f0

1 file changed

Lines changed: 9 additions & 3 deletions

File tree

test/parallel/test-debugger-exceptions.js

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,10 @@ 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(/ ok\n/);
3132
await cli.waitForInitialBreak();
33+
await cli.waitForPrompt();
3234
assert.deepStrictEqual(cli.breakInfo, { filename: script, line: 1 });
3335
await cli.command('breakOnException');
3436
await cli.stepCommand('c');
@@ -38,16 +40,20 @@ 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(/ ok\n/);
4245
await cli.waitForInitialBreak();
46+
await cli.waitForPrompt();
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(/ ok\n/);
5055
await cli.waitForInitialBreak();
56+
await cli.waitForPrompt();
5157
assert.deepStrictEqual(cli.breakInfo, { filename: script, line: 1 });
5258
await cli.command('c');
5359
await cli.waitFor(/disconnect/);

0 commit comments

Comments
 (0)