Commit 45fef372fcf for nodejs
commit 45fef372fcf3b8593dd32d1907e8ea19f7b3a9a7
Author: Filip Skokan <panva.ip@gmail.com>
Date: Sat Sep 26 09:57:16 2026 +0200
test: deflake debugger function name extraction
Evaluating expressions against the running target can trigger a V8
scope assertion. Keep the target paused and wait for the initial break
before checking the function formatting. Await debugger teardown.
Signed-off-by: Filip Skokan <panva.ip@gmail.com>
Assisted-by: Codex
PR-URL: https://github.com/nodejs/node/pull/66231
Reviewed-By: Aviv Keller <me@aviv.sh>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
diff --git a/test/parallel/test-debugger-extract-function-name.mjs b/test/parallel/test-debugger-extract-function-name.mjs
index b787750453f..1635dde7358 100644
--- a/test/parallel/test-debugger-extract-function-name.mjs
+++ b/test/parallel/test-debugger-extract-function-name.mjs
@@ -7,14 +7,12 @@ import startCLI from '../common/debugger.js';
import assert from 'assert';
-const env = {
- ...process.env,
- NODE_INSPECT_RESUME_ON_START: '1',
-};
-const cli = startCLI(
- [fixtures.path('debugger', 'alive.js')], [], { env });
+// Evaluating while the target is running can trigger a V8 scope assertion.
+// Keep it paused for these formatting checks.
+const cli = startCLI([fixtures.path('debugger', 'three-lines.js')]);
try {
+ await cli.waitForInitialBreak();
await cli.waitForPrompt();
await cli.command('exec a = function func() {}; a;');
assert.match(cli.output, /\[Function: func\]/);
@@ -33,5 +31,5 @@ try {
await cli.command('exec a = function * func() {}; a;');
assert.match(cli.output, /\[GeneratorFunction\]/);
} finally {
- cli.quit();
+ await cli.quit();
}