From 89d238631a88192d7f7e4542a745c8b986edd5dd Mon Sep 17 00:00:00 2001 From: Filip Skokan Date: Wed, 23 Sep 2026 09:10:36 +0200 Subject: [PATCH] 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 Assisted-by: Codex --- .../parallel/test-debugger-extract-function-name.mjs | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) 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(); }