Do not end the debug session after a setup snippet - #62
Merged
Conversation
This was referenced Aug 19, 2026
A test item with `setup=[...]` debugs its snippets and then its own body, as separate `debug_code` calls on one debug session. `debug_code` sends a `terminated` event when the code it was given finishes, and a client takes that as "the debuggee has ended" and disconnects — so the session was already gone by the time the test item's body ran, and no breakpoint in the item was ever hit. Breakpoints inside the snippet worked, which is what made the symptom confusing. Snippets now pass `notify_termination=false`, so only the item's own body reports termination. Requires DebugAdapter 3.2, which adds the keyword argument (julia-vscode/DebugAdapter.jl#122), to be released and vendored first. Closes julia-testitems/TestItemRunner.jl#107
davidanthoff
force-pushed
the
fix-debug-with-setup
branch
from
August 19, 2026 17:51
38368e3 to
08d03a7
Compare
davidanthoff
marked this pull request as ready for review
August 19, 2026 22:28
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes julia-testitems/TestItemRunner.jl#107.
Draft: blocked on julia-vscode/DebugAdapter.jl#122 being released and vendored. The
notify_terminationkeyword does not exist in the DebugAdapter copy underpackages/yet, so this cannot be merged beforescripts/update_vendored_packages.jlpicks up DebugAdapter 3.2.The bug
A test item with
setup=[...]debugs its snippets and then its own body, as separatedebug_codecalls on one debug session (TestItemServer.jl:688 and :778).debug_codesends aterminatedevent when the code it was given finishes. In DAP that means the debuggee has ended, so the client ends the debug session and sendsdisconnect— anddisconnect_requestputs:terminateon the session's command channel. The session was therefore already being torn down by the time the test item's own body was handed to it, and no breakpoint in the item could be hit. Breakpoints inside the snippet worked, which is what made the reported symptom confusing: "breakpoints within a used snippet are working. However, when stepping out of the snippet, the whole testitem again runs without stopping."I verified this against DebugAdapter directly before writing anything: two
debug_codecalls on one session produce twoterminatedevents. The regression test for that lives in the upstream PR, where a session can be driven end to end.The fix
Setup snippets pass
notify_termination=false, so only the test item's own body reports termination.No test on this side — exercising it needs a DAP client attached to the test process, which the upstream test does instead. Verification here is manual in VS Code once the vendored copy is updated.
🤖 Generated with Claude Code