Skip to content

Cancelled test-debug gestures leave no ghost terminal (Linux debug-tests flake) - #610

Merged
MelbourneDeveloper merged 1 commit into
mainfrom
fix/test-debug-ghost-terminal
Nov 19, 2026
Merged

MelbourneDeveloper merged 1 commit into
mainfrom
fix/test-debug-ghost-terminal

Conversation

@MelbourneDeveloper

Copy link
Copy Markdown
Collaborator

TLDR

A cancelled Test Explorer Debug gesture no longer leaves a leftover "SharpLsp Test Debug" terminal beside the next debug run. This is the cause of the repeated Linux debug-tests failures (the cancelled gesture leaves no ghost terminal beside the live debug run, 2 !== 1).

Details

  • test-debug.ts:
  • Live runs are unchanged: the terminal still opens, stays live while the debugger attaches, and closes when the run ends.

How Do The Automated Tests Prove It Works?

…s end disposes its terminal window, so a terminal VS Code never opened can no longer outlive its run
@MelbourneDeveloper
MelbourneDeveloper enabled auto-merge (squash) November 19, 2026 17:59
@MelbourneDeveloper
MelbourneDeveloper merged commit c2e1da0 into main Nov 19, 2026
63 checks passed
@MelbourneDeveloper
MelbourneDeveloper deleted the fix/test-debug-ghost-terminal branch November 19, 2026 18:43
MelbourneDeveloper added a commit that referenced this pull request Nov 19, 2026
…unting its own (#612)

## TLDR
The debug Stop suite no longer counts an earlier suite's still-open
test-debug terminal as a ghost of its own. It waits for that terminal to
close, and if one never does, fails with a message that names the leak.

## Details
- Even after #610, Linux `debug-tests` failed on #611 (head `0d31a1f`,
which includes #610). All four Stop variants failed together with `2 !==
1`.
- The pre-cancelled gesture no longer creates a terminal at all, so the
second terminal predates the test.
- The suite just before it, *Debug an MTP test*, ends while its module
is still in its own 30-second wait. That run's terminal closes only once
the run settles, and the Stop test counted every terminal of that name,
globally.
- `debug-test-kit.ts` gains `assertNoTerminalLeft(name, why)`. It waits
up to `DEBUG_SESSION_MS` for no terminal of that name to remain.
- `debug-test-stop-e2e.test.ts` calls it first, so its later "exactly
one terminal" check counts only what the test itself opened. The test
timeout grows by one `DEBUG_TEST_MS` to fit the wait.
- No assertion is removed or loosened. A terminal that never closes
still fails, now at the point that names it.

## How Do The Automated Tests Prove It Works?
- Locally, `debug-test-mtp-e2e` followed by `debug-test-stop-e2e` (CI's
order): 6 passing.
- On this PR's Linux `debug-tests` job, the four Stop variants must
pass. If an earlier suite really leaks a terminal, they fail with `every
earlier debug run closed its terminal once it settled` rather than the
misleading ghost count.
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.

1 participant