Skip to content

test: wait for debugger pause state on startup#63968

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

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 an actual pause state during startup, instead of relying only on
the human-readable break banner.

The helper now probes with setContextLineNumber(2), which requires the
debuggee to be paused and leaves the default context line setting
unchanged. It waits for both the probe response and the next prompt before
letting tests continue, so subsequent debugger commands do not consume
probe output.

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
@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
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.

Use setContextLineNumber(2) to probe the debugger CLI state. The
command requires a pause state and leaves the default context line
setting unchanged. Retry while it reports that execution is not paused.
Wait for the probe response and the next prompt together, so later test
commands cannot consume probe output.

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 05886b8 to fd71c75 Compare June 19, 2026 04:51
@trivikr trivikr marked this pull request as ready for review June 19, 2026 04:52
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