From c54396a967aecf4d9f84b90f697526b4a1582249 Mon Sep 17 00:00:00 2001 From: inoway46 Date: Sun, 1 Mar 2026 13:17:50 +0900 Subject: [PATCH 1/2] test: avoid flaky restart sync in debugger exceptions test --- test/parallel/test-debugger-exceptions.js | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/test/parallel/test-debugger-exceptions.js b/test/parallel/test-debugger-exceptions.js index 3f75161a6b6e3d..117a39c83af479 100644 --- a/test/parallel/test-debugger-exceptions.js +++ b/test/parallel/test-debugger-exceptions.js @@ -27,7 +27,9 @@ const path = require('path'); await cli.waitFor(/disconnect/); // Next run: With `breakOnException` it pauses in both places. - await cli.stepCommand('r'); + await cli.command('r'); + await cli.waitFor(/Debugger attached\./); + await cli.waitForPrompt(); await cli.waitForInitialBreak(); assert.deepStrictEqual(cli.breakInfo, { filename: script, line: 1 }); await cli.command('breakOnException'); @@ -38,7 +40,9 @@ const path = require('path'); // Next run: With `breakOnUncaught` it only pauses on the 2nd exception. await cli.command('breakOnUncaught'); - await cli.stepCommand('r'); // Also, the setting survives the restart. + await cli.command('r'); // Also, the setting survives the restart. + await cli.waitFor(/Debugger attached\./); + await cli.waitForPrompt(); await cli.waitForInitialBreak(); assert.deepStrictEqual(cli.breakInfo, { filename: script, line: 1 }); await cli.stepCommand('c'); @@ -46,7 +50,9 @@ const path = require('path'); // Next run: Back to the initial state! It should die again. await cli.command('breakOnNone'); - await cli.stepCommand('r'); + await cli.command('r'); + await cli.waitFor(/Debugger attached\./); + await cli.waitForPrompt(); await cli.waitForInitialBreak(); assert.deepStrictEqual(cli.breakInfo, { filename: script, line: 1 }); await cli.command('c'); From 1b3d3fe4a9a40f7057d1cdef1ad849220dabd065 Mon Sep 17 00:00:00 2001 From: inoway46 Date: Sun, 19 Apr 2026 13:30:54 +0900 Subject: [PATCH 2/2] test: wait for ok before initial break in debugger exceptions test --- test/parallel/test-debugger-exceptions.js | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/test/parallel/test-debugger-exceptions.js b/test/parallel/test-debugger-exceptions.js index 117a39c83af479..27818612301163 100644 --- a/test/parallel/test-debugger-exceptions.js +++ b/test/parallel/test-debugger-exceptions.js @@ -28,9 +28,9 @@ const path = require('path'); // Next run: With `breakOnException` it pauses in both places. await cli.command('r'); - await cli.waitFor(/Debugger attached\./); - await cli.waitForPrompt(); + await cli.waitFor(/ ok\n/); await cli.waitForInitialBreak(); + await cli.waitForPrompt(); assert.deepStrictEqual(cli.breakInfo, { filename: script, line: 1 }); await cli.command('breakOnException'); await cli.stepCommand('c'); @@ -41,9 +41,9 @@ const path = require('path'); // Next run: With `breakOnUncaught` it only pauses on the 2nd exception. await cli.command('breakOnUncaught'); await cli.command('r'); // Also, the setting survives the restart. - await cli.waitFor(/Debugger attached\./); - await cli.waitForPrompt(); + await cli.waitFor(/ ok\n/); await cli.waitForInitialBreak(); + await cli.waitForPrompt(); assert.deepStrictEqual(cli.breakInfo, { filename: script, line: 1 }); await cli.stepCommand('c'); assert.ok(cli.output.includes(`exception in ${script}:9`)); @@ -51,9 +51,9 @@ const path = require('path'); // Next run: Back to the initial state! It should die again. await cli.command('breakOnNone'); await cli.command('r'); - await cli.waitFor(/Debugger attached\./); - await cli.waitForPrompt(); + await cli.waitFor(/ ok\n/); await cli.waitForInitialBreak(); + await cli.waitForPrompt(); assert.deepStrictEqual(cli.breakInfo, { filename: script, line: 1 }); await cli.command('c'); await cli.waitFor(/disconnect/);