Skip to content

Commit a7a76cf

Browse files
committed
test: relax debugger attach sync in tests
1 parent 3725bd2 commit a7a76cf

13 files changed

+17
-4
lines changed

test/parallel/test-debugger-auto-resume.mjs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,9 @@ addLibraryPath(process.env);
2323

2424
const cli = startCLI([script], [], { env });
2525

26+
await cli.waitForPrompt();
2627
await cli.waitForInitialBreak();
28+
await cli.waitForPrompt();
2729
assert.deepStrictEqual(cli.breakInfo, {
2830
filename: script,
2931
line: 10,

test/parallel/test-debugger-backtrace.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ const path = require('path');
1717

1818
async function runTest() {
1919
try {
20+
await cli.waitForPrompt();
2021
await cli.waitForInitialBreak();
2122
await cli.waitForPrompt();
2223
await cli.stepCommand('c');

test/parallel/test-debugger-break.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ const script = path.relative(process.cwd(), scriptFullPath);
1414
const cli = startCLI([script]);
1515

1616
(async () => {
17+
await cli.waitForPrompt();
1718
await cli.waitForInitialBreak();
1819
await cli.waitForPrompt();
1920
assert.deepStrictEqual(

test/parallel/test-debugger-clear-breakpoints.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,8 @@ const path = require('path');
2020
throw error;
2121
}
2222

23-
return cli.waitForInitialBreak()
23+
return cli.waitForPrompt()
24+
.then(() => cli.waitForInitialBreak())
2425
.then(() => cli.waitForPrompt())
2526
.then(() => cli.command('sb("break.js", 3)'))
2627
.then(() => cli.command('sb("break.js", 9)'))

test/parallel/test-debugger-exceptions.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@ const path = require('path');
1717

1818
(async () => {
1919
try {
20-
await cli.waitForInitialBreak();
2120
await cli.waitForPrompt();
21+
await cli.waitForInitialBreak();
2222
await cli.waitForPrompt();
2323
assert.deepStrictEqual(cli.breakInfo, { filename: script, line: 1 });
2424

test/parallel/test-debugger-extract-function-name.mjs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import assert from 'assert';
1010
const cli = startCLI([fixtures.path('debugger', 'three-lines.js')]);
1111

1212
try {
13+
await cli.waitForPrompt();
1314
await cli.waitForInitialBreak();
1415
await cli.waitForPrompt();
1516
await cli.command('exec a = function func() {}; a;');

test/parallel/test-debugger-help.mjs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import assert from 'assert';
1010
const cli = startCLI([fixtures.path('debugger', 'empty.js')]);
1111

1212
try {
13+
await cli.waitForPrompt();
1314
await cli.waitForInitialBreak();
1415
await cli.waitForPrompt();
1516
await cli.command('help');

test/parallel/test-debugger-object-type-remote-object.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ const assert = require('assert');
1111
const cli = startCLI([fixtures.path('debugger/empty.js')]);
1212

1313
(async () => {
14+
await cli.waitForPrompt();
1415
await cli.waitForInitialBreak();
1516
await cli.waitForPrompt();
1617
await cli.command('exec new Date(0)');

test/parallel/test-debugger-preserve-breaks.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,9 @@ const script = path.relative(process.cwd(), scriptFullPath);
2929
await cli.stepCommand('c'); // hit line 3
3030
assert.deepStrictEqual(cli.breakInfo, { filename: script, line: 3 });
3131
await cli.command('restart');
32+
await cli.waitForPrompt();
3233
await cli.waitForInitialBreak();
34+
await cli.waitForPrompt();
3335
assert.deepStrictEqual(cli.breakInfo, { filename: script, line: 1 });
3436
await cli.stepCommand('c');
3537
assert.deepStrictEqual(cli.breakInfo, { filename: script, line: 2 });

test/parallel/test-debugger-profile.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ function delay(ms) {
3030

3131
try {
3232
(async () => {
33+
await cli.waitForPrompt();
3334
await cli.waitForInitialBreak();
3435
await cli.waitForPrompt();
3536
await cli.command('exec console.profile()');

0 commit comments

Comments
 (0)