Repository navigation
Keep the debugger install hint E2E fixture under the run root to fix Windows EBUSY teardown - #21918
Conversation
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]>
|
🚀 Dogfood this PR with:
curl -fsSL https://raw.githubusercontent.com/microsoft/aspire/main/eng/scripts/get-aspire-cli-pr.sh | bash -s -- 21918Or
iex "& { $(irm https://raw.githubusercontent.com/microsoft/aspire/main/eng/scripts/get-aspire-cli-pr.ps1) } 21918" |
Tests selector0 / 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)
How these were chosen — grouped by what changedJob reasons
Selection computed for commit |
There was a problem hiding this comment.
🔵 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
…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)
…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)
Description
What failed: The Windows VS Code extension E2E
edge-casesshard passedshows debugger install guidance while the Aspire panel and AppHost source are closed, then failed itsafter eachhook withEBUSY: resource busy or locked, rmdir '...\workspace\DebuggerInstallHintApp'. Examples: run 41501727353 / job 125481871205 and run 40535943499 / job 122310290672.Failure stats (14d, attempt 1)
CIworkflow 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.EBUSY: resource busy or locked, rmdir …DebuggerInstallHintAppFailing attempt-1 jobs, most recent first (2 of 2 log-verified hits):
ievangelist-go-remove-experimental-flagEBUSY: resource busy or locked, rmdir 'C:\Users\runneradmin\AppData\Local\Temp\aev-M7MFpn\workspace\DebuggerInstallHintA…dependabot/github_actions/github-actions-ebbe822166EBUSY: 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
--detachin 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 afteraspire stopsucceeds and the AppHost process exits. The in-sessionremoveGeneratedProjectrmdir 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.
ASPIRE_EXTENSION_E2E_RUN_ROOTin a per-invocation.e2e-debugger-install-hint-<n>directory, outside the workspace. The workspaceaspire.config.jsonstill selects it: the CLI adds a configured AppHost that sits outside the scan directory as a candidate.run-e2e.jsremoves the run root after VS Code and the session's processes exit, and it already tolerates Windows locks.createEmptyAppHostProjecttakes an optional output root. The default is unchanged, so other callers behave the same.e2eLaunchProfile.test.tslocks in the cleanup ownership boundary.Confidence
keeps the debugger install hint fixture under the run root and defers its deletion to the runner:AssertionError.e2eLaunchProfile.test.jssuite passes (127 tests).tsc -p .,tsc -p tsconfig.e2e.jsonandeslint srcalso pass.vscode-testunit suite and the Windows E2Eedge-casesshard. 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
🤖 Posted by AspireAgent (AI Agent)