Skip to content

fix(vscode): wait for source maps before running debugged tests - #80

Merged
fi3ework merged 1 commit into
mainfrom
fix-flaky-debug-e2e
Sep 29, 2026
Merged

fi3ework merged 1 commit into
mainfrom
fix-flaky-debug-e2e

Conversation

@fi3ework

Copy link
Copy Markdown
Member

Summary

Debugging a test from Test Explorer could run past a TypeScript breakpoint. Rstest runs in-memory compiled test files with inline source maps, and js-debug's Node launch defaults to pauseForSourceMap: false. The pool child then executes the test script as soon as it is parsed, while js-debug is still mapping the TS breakpoint onto it. On a slow run the line executes before the breakpoint is installed.

The generated debug launch now sets pauseForSourceMap: true. js-debug holds each script with a source map until its breakpoints are bound. This only affects debug runs.

Evidence, from a temporary macOS CI experiment running the breakpoint E2E on a fresh VS Code host each time:

  • Node default: 28/30 passed. Both failing js-debug traces contain no pause on the pool child, and the generated breakpoint is installed 13–24 ms after the test script is parsed, at the same location a passing run stops on.
  • pauseForSourceMap: true: 30/30 passed. The trace shows the instrumentation pause holding the test script until the breakpoint is set, then the breakpoint hit.

Related Links

Checklist

  • Tests updated (or not required). The launch-configuration unit test asserts the option; the existing debug E2E covers the breakpoint.
  • Documentation updated (or not required).

CI reproduction passed 28/30 runs with Node defaults and 30/30 with source-map pauses.
Failing traces show no pool-child instrumentation pause and a breakpoint installed after the target line ran.
The passing reference pauses before execution and hits the same generated location.
Wait for source maps so in-memory Rstest bundles cannot outrun TypeScript breakpoint binding.

Closes #79
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 29, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-09-29T14:48:59.516484Z d1ba1ad PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@fi3ework
fi3ework merged commit 1199f83 into main Sep 29, 2026
3 checks passed
@fi3ework
fi3ework deleted the fix-flaky-debug-e2e branch September 29, 2026 15:09
@fi3ework fi3ework mentioned this pull request Sep 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Flaky: debug E2E misses the breakpoint on macOS

1 participant