Skip to content

test: wait for debugger pause state on startup#63968

Draft
trivikr wants to merge 1 commit into
nodejs:mainfrom
trivikr:test-debugger-exec-scope
Draft

test: wait for debugger pause state on startup#63968
trivikr wants to merge 1 commit into
nodejs:mainfrom
trivikr:test-debugger-exec-scope

Conversation

@trivikr

@trivikr trivikr commented Jun 18, 2026

Copy link
Copy Markdown
Member

This updates the debugger test helper to wait for the debugger CLI
to reach a paused state instead of depending only on the printed
initial break banner.

The helper now probes with list() and retries while the CLI reports
that execution is not paused. Each probe wait uses the remaining
timeout budget so the overall startup wait still respects the helper
timeout.

Refs: https://github.com/nodejs/node/actions/runs/27683841143/job/81877654047

Error log
Path: parallel/test-debugger-exec-scope
Error: --- stderr ---
/Users/runner/work/node/node/node/test/common/debugger.js:92
        const timeoutErr = new Error(`Timeout (${TIMEOUT}) while waiting for ${pattern}`);
                           ^

Error: Timeout (15000) while waiting for /break (?:on start )?in/i
    at /Users/runner/work/node/node/node/test/common/debugger.js:92:28
    at new Promise (<anonymous>)
    at Object.waitFor (/Users/runner/work/node/node/node/test/common/debugger.js:67:14)
    at Object.waitForInitialBreak (/Users/runner/work/node/node/node/test/common/debugger.js:116:18)
    at file:///Users/runner/work/node/node/node/test/parallel/test-debugger-exec-scope.mjs:13:13
    at ModuleJob.run (node:internal/modules/esm/module_job:447:25)
    at async node:internal/modules/esm/loader:646:26
    at async asyncRunEntryPointWithESMLoader (node:internal/modules/run_main:101:5) {
  output: '\n' +
    '< Debugger listening on ws://127.0.0.1:55107/b43be8c5-442d-49a8-80ce-1ff2d58af386\n' +
    '< For help, see: https://nodejs.org/learn/getting-started/debugging\n' +
    '< \n' +
    'connecting to 127.0.0.1:55107 ...\n' +
    '< Debugger attached.\n' +
    '< \n' +
    '\n' +
    ' ok\n' +
    '\n' +
    'debug> '
}

Assisted-by: openai:gpt-5.5

@nodejs-github-bot nodejs-github-bot added needs-ci PRs that need a full CI run. test Issues and PRs related to the tests. labels Jun 18, 2026
@trivikr trivikr added flaky-test Issues and PRs related to the tests with unstable failures on the CI. request-ci Add this label to start a Jenkins CI on a PR. debugger Issues and PRs related to the debugger subsystem. labels Jun 18, 2026
The debugger helper waited for the initial break by matching the
human-readable break banner. On slow systems the CLI can reach the
prompt before that banner is observed, causing flaky timeouts.

Probe the debugger CLI state with list() and retry while it reports
that execution is not paused. Use the remaining timeout budget for
each probe wait so the startup wait still respects the helper timeout.

Signed-off-by: Kamat, Trivikram <16024985+trivikr@users.noreply.github.com>
Assisted-by: openai:gpt-5.5
@trivikr trivikr force-pushed the test-debugger-exec-scope branch from 56ea5cb to 05886b8 Compare June 18, 2026 04:27
@trivikr trivikr marked this pull request as draft June 18, 2026 16:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

debugger Issues and PRs related to the debugger subsystem. flaky-test Issues and PRs related to the tests with unstable failures on the CI. needs-ci PRs that need a full CI run. request-ci Add this label to start a Jenkins CI on a PR. test Issues and PRs related to the tests.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants