Skip to content

Keep the debugger install hint E2E fixture under the run root to fix Windows EBUSY teardown - #21918

Merged
Mitch Denny (mitchdenny) merged 1 commit into
mainfrom
aspireagent/edge-case-debugger-hint-fixture-run-root
Nov 8, 2026
Merged

Mitch Denny (mitchdenny) merged 1 commit into
mainfrom
aspireagent/edge-case-debugger-hint-fixture-run-root

Conversation

@davidfowl

@davidfowl David Fowler (davidfowl) commented Nov 8, 2026 •

Copy link
Copy Markdown
Collaborator

Description

What failed: The Windows VS Code extension E2E edge-cases shard passed shows debugger install guidance while the Aspire panel and AppHost source are closed, then failed its after each hook with EBUSY: resource busy or locked, rmdir '...\workspace\DebuggerInstallHintApp'. Examples: run 41501727353 / job 125481871205 and run 40535943499 / job 122310290672.

Failure stats (14d, attempt 1)

CI workflow on microsoft/aspire, runs created 2026-10-25 06:28 → 2026-11-08 06:28 UTC, attempt 1 only. Denominator: attempt-1 jobs that ran (success or failure). Hits: the failed job's log matches the signature. Jobs that lost their runner, which have no log, are excluded. Main runs have no reruns, so their flake check is the next main run of the job.

Signature EBUSY: resource busy or locked, rmdir …DebuggerInstallHintApp
Job VS Code extension E2E (Windows, edge-cases)
main pushes: hits / runs 0 / 153 (0.00%)
main pushes, 30d: hits / runs 0 / 265 (0.00%). The 16 days before the 14d window add 0 hits.
PR runs: hits / runs 2 / 798 (0.25%); 0 PR-caused excluded
Combined rate 2 / 951 = 0.21%
Flake check PR: 2/2 rerun hits passed on rerun (0 never rerun)
First / last hit 2026-10-27 / 2026-11-02
Still hitting main? Last main hit: never. 79 main runs since the last hit (2026-11-02), with 0 hits
Fix evidence Local: source-contract test fails before and passes after. The Windows EBUSY was not reproduced. This PR's CI: Windows edge-cases passed 1/1.

Failing attempt-1 jobs, most recent first (2 of 2 log-verified hits):

Date (UTC) Branch Job Signature excerpt
2026-11-02 18:33 ievangelist-go-remove-experimental-flag VS Code extension E2E (Windows, edge-cases) EBUSY: resource busy or locked, rmdir 'C:\Users\runneradmin\AppData\Local\Temp\aev-M7MFpn\workspace\DebuggerInstallHintA…
2026-10-27 15:56 dependabot/github_actions/github-actions-ebbe822166 VS Code extension E2E (Windows, edge-cases) EBUSY: resource busy or locked, rmdir 'C:\Users\runneradmin\AppData\Local\Temp\aev-8x6mbU\workspace\DebuggerInstallHintA…

Verdict: WEAK. Only 2 hits (both PR runs, both passed on rerun, never on main). No hit since 2026-11-02 (79 main runs). The fix is not validated against the actual lock.

Why: The fixture AppHost starts DCP with --detach in the AppHost's working directory, which is the generated project directory. DCP can outlive the AppHost while it cleans up, so Windows keeps that directory busy even after aspire stop succeeds and the AppHost process exits. The in-session removeGeneratedProject rmdir then fails. In the second run, the outer runner later logs the same lock as a non-blocking warning, so the lock outlives the test.

Fix: This follows the #20289 pattern.

  • The test now creates the fixture under the runner-owned ASPIRE_EXTENSION_E2E_RUN_ROOT in a per-invocation .e2e-debugger-install-hint-<n> directory, outside the workspace. The workspace aspire.config.json still selects it: the CLI adds a configured AppHost that sits outside the scan directory as a candidate.
  • Teardown still stops the AppHost and restores the workspace config. It no longer deletes the directory. run-e2e.js removes the run root after VS Code and the session's processes exit, and it already tolerates Windows locks.
  • createEmptyAppHostProject takes an optional output root. The default is unchanged, so other callers behave the same.
  • A new source-contract test in e2eLaunchProfile.test.ts locks in the cleanup ownership boundary.

Confidence

  • New test keeps the debugger install hint fixture under the run root and defers its deletion to the runner:
    • Before (E2E source changes reverted, test kept): fails with an AssertionError.
    • After: passes.
  • The full compiled e2eLaunchProfile.test.js suite passes (127 tests). tsc -p ., tsc -p tsconfig.e2e.json and eslint src also pass.
  • Not run locally: the Electron vscode-test unit suite and the Windows E2E edge-cases shard. The EBUSY only reproduces on Windows. This PR's CI runs that shard, which is the end-to-end check.

How we stop this recurring: Fixtures that run an AppHost now live under the run root, and the runner deletes them. The contract test fails if this test goes back to deleting its fixture in-session.

Refs #21600, #19282

Checklist

  • Is this feature complete?
    • Yes. Ready to ship.
    • No. Follow-up changes expected.
  • Are you including unit tests for the changes and scenario tests if relevant?
    • Yes
    • No
  • Did you add public API?
    • Yes
    • No
  • Does the change make any security assumptions or guarantees?
    • Yes
    • No

🤖 Posted by AspireAgent (AI Agent)

The AppHost starts DCP with --detach in the AppHost directory, and DCP can
outlive a successful aspire stop while it cleans up. On Windows the edge-case
shard's after-each hook then failed with EBUSY deleting DebuggerInstallHintApp.

Create the fixture under ASPIRE_EXTENSION_E2E_RUN_ROOT outside the workspace and
let run-e2e.js delete it after the session exits, following #20289. Add a
source-contract test for the cleanup ownership boundary.

Co-authored-by: Copilot <[email protected]>
@davidfowl David Fowler (davidfowl) added the agent:working An AI agent is actively working on this issue or PR label Nov 8, 2026
@github-actions

github-actions Bot commented Nov 8, 2026

Copy link
Copy Markdown
Contributor

🚀 Dogfood this PR with:

⚠️ WARNING: Do not do this without first carefully reviewing the code of this PR to satisfy yourself it is safe.

curl -fsSL https://raw.githubusercontent.com/microsoft/aspire/main/eng/scripts/get-aspire-cli-pr.sh | bash -s -- 21918

Or

  • Run remotely in PowerShell:
iex "& { $(irm https://raw.githubusercontent.com/microsoft/aspire/main/eng/scripts/get-aspire-cli-pr.ps1) } 21918"

@github-actions

github-actions Bot commented Nov 8, 2026

Copy link
Copy Markdown
Contributor

Tests selector

0 / 101 PR test projects · 2 PR jobs, from 3 changed files.

Selected PR test projects (0 / 101)

none — no PR-gated .NET test projects run for this change.

Selected PR jobs (2)

extension-e2e, extension-unit


How these were chosen — grouped by what changed

Job reasons

Job Triggered by
extension-e2e extension/src/test-e2e/edgeCases.e2e.test.ts, extension/src/test-e2e/helpers/fixtures.ts, extension/src/test/e2eLaunchProfile.test.ts
extension-unit extension/src/test-e2e/edgeCases.e2e.test.ts, extension/src/test-e2e/helpers/fixtures.ts, extension/src/test/e2eLaunchProfile.test.ts

Selection computed for commit a24c064.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 Needs a closer look

The Windows-only detached-DCP directory-lock fix lacks a passing Windows edge-cases E2E result, including teardown, and source-contract checks cannot validate the platform-specific locking behavior.

No open issues 🎉

What changed in this PR

Addresses Windows EBUSY teardown failures in the VS Code extension’s debugger-install-hint E2E test by moving its fixture outside the workspace and deferring deletion to the outer runner, following the pattern from #20289.

Changes:

  • Creates a per-invocation fixture under the run root while preserving AppHost shutdown and workspace configuration restoration.
  • Adds an optional output path to the fixture helper without changing its default behavior.
  • Adds a source-contract test guarding fixture placement and cleanup ownership.
File Description
extension/​src/​test/​e2eLaunchProfile.test.ts Adds assertions for run-root placement and runner-owned deletion.
extension/​src/​test-e2e/​helpers/​fixtures.ts Supports a custom output path and checks generated files there.
extension/​src/​test-e2e/​edgeCases.e2e.test.ts Moves the fixture under the run root and removes in-session deletion.

Review effort: Balanced

@mitchdenny
Mitch Denny (mitchdenny) merged commit 07ccac0 into main Nov 8, 2026
104 checks passed
@microsoft-github-policy-service microsoft-github-policy-service Bot added this to the 17.1 milestone Nov 8, 2026
Mitch Denny (mitchdenny) pushed a commit that referenced this pull request Nov 10, 2026
…Windows EBUSY teardown (#21918)

## Description

**What failed:** The Windows VS Code extension E2E `edge-cases` shard
passed `shows debugger install guidance while the Aspire panel and
AppHost source are closed`, then failed its `after each` hook with
`EBUSY: resource busy or locked, rmdir
'...\workspace\DebuggerInstallHintApp'`. Examples: [run 41501727353 /
job
125481871205](https://github.com/microsoft/aspire/actions/runs/41501727353/job/125481871205)
and [run 40535943499 / job
122310290672](https://github.com/microsoft/aspire/actions/runs/40535943499/job/122310290672).

## Failure stats (14d, attempt 1)

`CI` workflow on microsoft/aspire, runs created 2026-10-25 06:28 →
2026-11-08 06:28 UTC, **attempt 1 only**. Denominator: attempt-1 jobs
that ran (success or failure). Hits: the failed job's log matches the
signature. Jobs that lost their runner, which have no log, are excluded.
Main runs have no reruns, so their flake check is the next main run of
the job.

| | |
|---|---|
| Signature | `EBUSY: resource busy or locked, rmdir
…DebuggerInstallHintApp` |
| Job | VS Code extension E2E (Windows, edge-cases) |
| main pushes: hits / runs | 0 / 153 (0.00%) |
| main pushes, 30d: hits / runs | 0 / 265 (0.00%). The 16 days before
the 14d window add 0 hits. |
| PR runs: hits / runs | 2 / 798 (0.25%); 0 PR-caused excluded |
| Combined rate | 2 / 951 = **0.21%** |
| Flake check | PR: 2/2 rerun hits passed on rerun (0 never rerun) |
| First / last hit | 2026-10-27 / 2026-11-02 |
| Still hitting main? | Last main hit: never. 79 main runs since the
last hit (2026-11-02), with 0 hits |
| Fix evidence | Local: source-contract test fails before and passes
after. The Windows EBUSY was not reproduced. This PR's CI: Windows
edge-cases passed 1/1. |

Failing attempt-1 jobs, most recent first (2 of 2 log-verified hits):

| Date (UTC) | Branch | Job | Signature excerpt |
|---|---|---|---|
| [2026-11-02
18:33](https://github.com/microsoft/aspire/actions/runs/41501727353/job/125481871205)
| `ievangelist-go-remove-experimental-flag` | VS Code extension E2E
(Windows, edge-cases) | `EBUSY: resource busy or locked, rmdir
'C:\Users\runneradmin\AppData\Local\Temp\aev-M7MFpn\workspace\DebuggerInstallHintA…`
|
| [2026-10-27
15:56](https://github.com/microsoft/aspire/actions/runs/40535943499/job/122310290672)
| `dependabot/github_actions/github-actions-ebbe822166` | VS Code
extension E2E (Windows, edge-cases) | `EBUSY: resource busy or locked,
rmdir
'C:\Users\runneradmin\AppData\Local\Temp\aev-8x6mbU\workspace\DebuggerInstallHintA…`
|

**Verdict: WEAK.** Only **2 hits** (both PR runs, both passed on rerun,
never on main). No hit since 2026-11-02 (79 main runs). The fix is not
validated against the actual lock.

<!-- /failure-stats -->

**Why:** The fixture AppHost starts DCP with `--detach` in the AppHost's
working directory, which is the generated project directory. DCP can
outlive the AppHost while it cleans up, so Windows keeps that directory
busy even after `aspire stop` succeeds and the AppHost process exits.
The in-session `removeGeneratedProject` rmdir then fails. In the second
run, the outer runner later logs the same lock as a non-blocking
warning, so the lock outlives the test.

**Fix:** This follows the #20289 pattern.
- The test now creates the fixture under the runner-owned
`ASPIRE_EXTENSION_E2E_RUN_ROOT` in a per-invocation
`.e2e-debugger-install-hint-<n>` directory, outside the workspace. The
workspace `aspire.config.json` still selects it: the CLI adds a
configured AppHost that sits outside the scan directory as a candidate.
- Teardown still stops the AppHost and restores the workspace config. It
no longer deletes the directory. `run-e2e.js` removes the run root after
VS Code and the session's processes exit, and it already tolerates
Windows locks.
- `createEmptyAppHostProject` takes an optional output root. The default
is unchanged, so other callers behave the same.
- A new source-contract test in `e2eLaunchProfile.test.ts` locks in the
cleanup ownership boundary.

## Confidence

- New test `keeps the debugger install hint fixture under the run root
and defers its deletion to the runner`:
- **Before** (E2E source changes reverted, test kept): fails with an
`AssertionError`.
  - **After**: passes.
- The full compiled `e2eLaunchProfile.test.js` suite passes (127 tests).
`tsc -p .`, `tsc -p tsconfig.e2e.json` and `eslint src` also pass.
- **Not run locally:** the Electron `vscode-test` unit suite and the
Windows E2E `edge-cases` shard. The EBUSY only reproduces on Windows.
This PR's CI runs that shard, which is the end-to-end check.

**How we stop this recurring:** Fixtures that run an AppHost now live
under the run root, and the runner deletes them. The contract test fails
if this test goes back to deleting its fixture in-session.

Refs #21600, #19282

## Checklist

- Is this feature complete?
  - [x] Yes. Ready to ship.
  - [ ] No. Follow-up changes expected.
- Are you including unit tests for the changes and scenario tests if
relevant?
  - [x] Yes
  - [ ] No
- Did you add public API?
  - [ ] Yes
  - [x] No
- Does the change make any security assumptions or guarantees?
  - [ ] Yes
  - [x] No

**🤖 Posted by AspireAgent (AI Agent)**

Co-authored-by: davidfowl <[email protected]>
Co-authored-by: Copilot <[email protected]>
(cherry picked from commit 07ccac0)
Mitch Denny (mitchdenny) pushed a commit that referenced this pull request Nov 10, 2026
…Windows EBUSY teardown (#21918)

## Description

**What failed:** The Windows VS Code extension E2E `edge-cases` shard
passed `shows debugger install guidance while the Aspire panel and
AppHost source are closed`, then failed its `after each` hook with
`EBUSY: resource busy or locked, rmdir
'...\workspace\DebuggerInstallHintApp'`. Examples: [run 41501727353 /
job
125481871205](https://github.com/microsoft/aspire/actions/runs/41501727353/job/125481871205)
and [run 40535943499 / job
122310290672](https://github.com/microsoft/aspire/actions/runs/40535943499/job/122310290672).

## Failure stats (14d, attempt 1)

`CI` workflow on microsoft/aspire, runs created 2026-10-25 06:28 →
2026-11-08 06:28 UTC, **attempt 1 only**. Denominator: attempt-1 jobs
that ran (success or failure). Hits: the failed job's log matches the
signature. Jobs that lost their runner, which have no log, are excluded.
Main runs have no reruns, so their flake check is the next main run of
the job.

| | |
|---|---|
| Signature | `EBUSY: resource busy or locked, rmdir
…DebuggerInstallHintApp` |
| Job | VS Code extension E2E (Windows, edge-cases) |
| main pushes: hits / runs | 0 / 153 (0.00%) |
| main pushes, 30d: hits / runs | 0 / 265 (0.00%). The 16 days before
the 14d window add 0 hits. |
| PR runs: hits / runs | 2 / 798 (0.25%); 0 PR-caused excluded |
| Combined rate | 2 / 951 = **0.21%** |
| Flake check | PR: 2/2 rerun hits passed on rerun (0 never rerun) |
| First / last hit | 2026-10-27 / 2026-11-02 |
| Still hitting main? | Last main hit: never. 79 main runs since the
last hit (2026-11-02), with 0 hits |
| Fix evidence | Local: source-contract test fails before and passes
after. The Windows EBUSY was not reproduced. This PR's CI: Windows
edge-cases passed 1/1. |

Failing attempt-1 jobs, most recent first (2 of 2 log-verified hits):

| Date (UTC) | Branch | Job | Signature excerpt |
|---|---|---|---|
| [2026-11-02
18:33](https://github.com/microsoft/aspire/actions/runs/41501727353/job/125481871205)
| `ievangelist-go-remove-experimental-flag` | VS Code extension E2E
(Windows, edge-cases) | `EBUSY: resource busy or locked, rmdir
'C:\Users\runneradmin\AppData\Local\Temp\aev-M7MFpn\workspace\DebuggerInstallHintA…`
|
| [2026-10-27
15:56](https://github.com/microsoft/aspire/actions/runs/40535943499/job/122310290672)
| `dependabot/github_actions/github-actions-ebbe822166` | VS Code
extension E2E (Windows, edge-cases) | `EBUSY: resource busy or locked,
rmdir
'C:\Users\runneradmin\AppData\Local\Temp\aev-8x6mbU\workspace\DebuggerInstallHintA…`
|

**Verdict: WEAK.** Only **2 hits** (both PR runs, both passed on rerun,
never on main). No hit since 2026-11-02 (79 main runs). The fix is not
validated against the actual lock.

<!-- /failure-stats -->

**Why:** The fixture AppHost starts DCP with `--detach` in the AppHost's
working directory, which is the generated project directory. DCP can
outlive the AppHost while it cleans up, so Windows keeps that directory
busy even after `aspire stop` succeeds and the AppHost process exits.
The in-session `removeGeneratedProject` rmdir then fails. In the second
run, the outer runner later logs the same lock as a non-blocking
warning, so the lock outlives the test.

**Fix:** This follows the #20289 pattern.
- The test now creates the fixture under the runner-owned
`ASPIRE_EXTENSION_E2E_RUN_ROOT` in a per-invocation
`.e2e-debugger-install-hint-<n>` directory, outside the workspace. The
workspace `aspire.config.json` still selects it: the CLI adds a
configured AppHost that sits outside the scan directory as a candidate.
- Teardown still stops the AppHost and restores the workspace config. It
no longer deletes the directory. `run-e2e.js` removes the run root after
VS Code and the session's processes exit, and it already tolerates
Windows locks.
- `createEmptyAppHostProject` takes an optional output root. The default
is unchanged, so other callers behave the same.
- A new source-contract test in `e2eLaunchProfile.test.ts` locks in the
cleanup ownership boundary.

## Confidence

- New test `keeps the debugger install hint fixture under the run root
and defers its deletion to the runner`:
- **Before** (E2E source changes reverted, test kept): fails with an
`AssertionError`.
  - **After**: passes.
- The full compiled `e2eLaunchProfile.test.js` suite passes (127 tests).
`tsc -p .`, `tsc -p tsconfig.e2e.json` and `eslint src` also pass.
- **Not run locally:** the Electron `vscode-test` unit suite and the
Windows E2E `edge-cases` shard. The EBUSY only reproduces on Windows.
This PR's CI runs that shard, which is the end-to-end check.

**How we stop this recurring:** Fixtures that run an AppHost now live
under the run root, and the runner deletes them. The contract test fails
if this test goes back to deleting its fixture in-session.

Refs #21600, #19282

## Checklist

- Is this feature complete?
  - [x] Yes. Ready to ship.
  - [ ] No. Follow-up changes expected.
- Are you including unit tests for the changes and scenario tests if
relevant?
  - [x] Yes
  - [ ] No
- Did you add public API?
  - [ ] Yes
  - [x] No
- Does the change make any security assumptions or guarantees?
  - [ ] Yes
  - [x] No

**🤖 Posted by AspireAgent (AI Agent)**

Co-authored-by: davidfowl <[email protected]>
Co-authored-by: Copilot <[email protected]>
(cherry picked from commit 07ccac0)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants