Repository navigation
Coordinate project builds when the IDE cannot launch projects (fix VS Code E2E tree-actions flake) - #21624
Conversation
When an IDE debug session advertises an explicit capability list without
"project" (VS Code without the C# extension), DCP runs project resources as
plain processes. The build coordinator was skipped, so each resource ran its
own implicit `dotnet run` build. Resources sharing a project built it
concurrently and one could exit on a locked obj/ file
(rjsmrazor.dswa.cache.json), which made the VS Code E2E tree-actions test
flaky ("could not find a matching endpoint").
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 -- 21624Or
iex "& { $(irm https://raw.githubusercontent.com/microsoft/aspire/main/eng/scripts/get-aspire-cli-pr.ps1) } 21624" |
This comment has been minimized.
This comment has been minimized.
There was a problem hiding this comment.
🟢 Approval recommended
No active review issues are blocking approval.
No open issues 🎉
What changed in this PR
This PR updates Aspire’s .NET project build coordination to prevent concurrent builds of a shared project when an IDE cannot launch projects, addressing the VS Code tree-actions flake tracked in #19282 and #21600.
Changes:
- Coordinates builds when an explicit IDE capability list lacks
project, while preserving legacy IDE behavior. - Adds regression tests for empty and non-project capability lists, verifying shared build coordination and build suppression.
- Updates the design documentation to describe the revised capability handling.
| File | Description |
|---|---|
| tests/Aspire.Hosting.Dotnet.Tests/DotnetProjectBuildCoordinatorTests.cs | Adds shared-project regression coverage for process-only launches. |
| src/Aspire.Hosting.Dotnet/DotnetProjectBuildCoordinator.cs | Enables coordinated builds when explicit IDE capabilities exclude project launches. |
| docs/plans/project-v2-csharpprogram-watch.md | Documents the updated build coordination rules. |
Review effort: Balanced
|
Retrying the failed CI jobs for this pull request from the CI run attempt. The rerun is being tracked in the rerun attempt. |
|
CI on head
🤖 Posted by AspireAgent (AI Agent) |
Co-authored-by: Copilot <[email protected]>
Tests selector20 / 101 PR test projects · 4 PR jobs, from 2 changed files. Selected PR test projects (20 / 101)
Selected PR jobs (4)
How these were chosen — grouped by what changed
🔧 show 17
📦 affected project 🧪 Job reasons
Selection computed for commit |
|
Retrying the failed CI jobs for this pull request from the CI run attempt. The rerun is being tracked in the rerun attempt. |
|
✅ No documentation update needed. docs_optional → internal_refactor (proven false positive of the only triggered signal).
|
…tions E2E (#21914) ## Description The Linux and Windows `tree-actions` VS Code E2E shard fails with `AssertionError: Expected e2e-worker to expose an endpoint URL.` in *routes view, copy, endpoint, log, and resource commands through tree handlers*. It is the most frequent flake since #21624. Examples: [run 41946839177 / job 126989027692](https://github.com/microsoft/aspire/actions/runs/41946839177/job/126989027692) (Linux), [run 41967348150 / job 127053704182](https://github.com/microsoft/aspire/actions/runs/41967348150/job/127053704182) (Windows, main), [run 41980257054 / job 127096573746](https://github.com/microsoft/aspire/actions/runs/41980257054/job/127096573746) (Windows). #21796 lists more. ## 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 | `Expected e2e-worker to expose an endpoint URL.` | | Job | VS Code extension E2E (Linux + Windows, tree-actions) | | main pushes: hits / runs | 8 / 306 (2.61%) | | main pushes, 30d: hits / runs | 8 / 530 (1.51%). The 16 days before the 14d window add 0 hits. | | PR runs: hits / runs | 28 / 1605 (1.74%); 0 PR-caused excluded | | Combined rate | 36 / 1911 = **1.88%** | | Flake check | main: next main run of the job passed 8/8; PR: 24/25 rerun hits passed on rerun (3 never rerun) | | First / last hit | 2026-11-05 / 2026-11-08 | | Still hitting main? | Yes, still active: last hit 2026-11-08; last main hit 2026-11-07 | | Fix evidence | Local real E2E: injected 5s delay 3/3 fail → 3/3 pass; natural run 1/1 pass. This PR's CI: tree-actions Linux and Windows passed 1/1 each. | Failing attempt-1 jobs, most recent first (10 of 34 log-verified hits): | Date (UTC) | Branch | Job | Signature excerpt | |---|---|---|---| | [2026-11-08 06:06](https://github.com/microsoft/aspire/actions/runs/42453400853/job/128650958075) | `aspireagent/vscode-bridge-scoped-fake-timers` | VS Code extension E2E (Windows, tree-actions) | `Expected e2e-worker to expose an endpoint URL.` | | [2026-11-08 05:17](https://github.com/microsoft/aspire/actions/runs/42450180289/job/128641295561) | `darc-main-252ee2c2-deac-4980-a34a-b797f49158de` | VS Code extension E2E (Windows, tree-actions) | `Expected e2e-worker to expose an endpoint URL.` | | [2026-11-08 04:40](https://github.com/microsoft/aspire/actions/runs/42447773687/job/128633232882) | `aspireagent/doctor-cancel-dcp-cleanup` | VS Code extension E2E (Windows, tree-actions) | `Expected e2e-worker to expose an endpoint URL.` | | [2026-11-08 04:32](https://github.com/microsoft/aspire/actions/runs/42447210418/job/128631545572) | `aspireagent/resource-attach-proof-resume-aborted-inspection` | VS Code extension E2E (Windows, tree-actions) | `Expected e2e-worker to expose an endpoint URL.` | | [2026-11-07 21:02](https://github.com/microsoft/aspire/actions/runs/42413947055/job/128538664400) | **main** | VS Code extension E2E (Windows, tree-actions) | `Expected e2e-worker to expose an endpoint URL.` | | [2026-11-07 03:55](https://github.com/microsoft/aspire/actions/runs/42336149573/job/128297445902) | `sebros/resources-compact-view-regression-4abee4` | VS Code extension E2E (Windows, tree-actions) | `Expected e2e-worker to expose an endpoint URL.` | | [2026-11-06 23:20](https://github.com/microsoft/aspire/actions/runs/42311290959/job/128230943448) | **main** | VS Code extension E2E (Windows, tree-actions) | `Expected e2e-worker to expose an endpoint URL.` | | [2026-11-06 22:50](https://github.com/microsoft/aspire/actions/runs/42307718588/job/128210216707) | `ellahathaway-stop-idle-extension-polling` | VS Code extension E2E (Windows, tree-actions) | `Expected e2e-worker to expose an endpoint URL.` | | [2026-11-06 20:25](https://github.com/microsoft/aspire/actions/runs/42288258477/job/128147538335) | **main** | VS Code extension E2E (Linux, tree-actions) | `Expected e2e-worker to expose an endpoint URL.` | | [2026-11-06 20:20](https://github.com/microsoft/aspire/actions/runs/42287581178/job/128143472756) | `ellahathaway-clarify-agent-init-output` | VS Code extension E2E (Windows, tree-actions) | `Expected e2e-worker to expose an endpoint URL.` | A strict re-scan of the job logs confirmed 34 of the 36 hits counted above; the table lists only confirmed hits. The rates above use the original count. **Verdict: STRONG.** The most frequent signature here: 36 hits since 2026-11-05 (8 on main), still hitting today. 24 of the 25 PR hits that were rerun passed on rerun, and all 8 main hits passed on the next main run. The real-E2E before/after repro shows the exact CI assertion. The PR's own CI is 1 run per OS. That is not statistical proof on its own: at a 1.9% rate, ~160 clean runs are needed for 95% confidence. <!-- /failure-stats --> **Why:** the spec captures `e2e-worker` from the first snapshot where it is `Running` and later reads its endpoint URL from that same object. DCP activates the worker's endpoint shortly after the resource reaches `Running`, and the backchannel omits inactive URLs, so the first `Running` snapshot can have `urls: []`. The URL-bearing snapshot arrives a few milliseconds later, but the spec never re-reads it. Since #21624, the worker reaches `Running` after the extension's `describe --follow` attaches, so this URL-less snapshot is now visible to the spec. **Fix:** wait with the existing `waitForRunningResourceWithUrl('e2e-worker', 'http:', 180000)` helper (already used by the Azure Functions spec) instead of `waitForResourceState('e2e-worker', ['Running'])`. This is a test-only change, and the endpoint assertion is unchanged. Fixes #21796 ## Confidence - **Real E2E, paired before/after (Linux, xvfb, real VS Code 1.130.0, CLI/DCP/VSIX/NuGets from main CI run 42413947055):** a local-only CLI wrapper delays the first URL-bearing `Running` `e2e-worker` line from `describe --follow` by 5s. The 5s delay is well above the 200ms state poll interval, so the URL-less snapshot is always observed. - Before (spec on `origin/main`): **3/3 failed** (6 passing, 1 failing), each with the exact CI assertion. - After (this PR): **3/3 passed** (7/7). - **Natural (no injection) run with the fix:** 1/1 passed (7/7). Locally, the URL-bearing `Running` snapshot followed the URL-less one by 2ms. - **Other checks:** eslint on the spec, `tsc` for both `tsconfig.e2e.json` and the unit project, and `e2eResourceReadiness.test.ts` (9/9, run with mocha directly) all pass. - **Not run locally:** the Windows `tree-actions` shard, other E2E shards, and `vscode-test`-hosted unit tests (the VS Code download host is blocked in my environment). CI covers these. **How we stop this recurring:** E2E specs that read resource URLs should wait on `waitForRunningResourceWithUrl` instead of a state-only `Running` gate, because state and URL activation arrive as separate snapshots. Related: #21854 made the same change but was closed without being merged. ## 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 (the change is to an E2E scenario test; the helper it uses already has unit coverage) - [ ] 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]>
…tions E2E (#21914) ## Description The Linux and Windows `tree-actions` VS Code E2E shard fails with `AssertionError: Expected e2e-worker to expose an endpoint URL.` in *routes view, copy, endpoint, log, and resource commands through tree handlers*. It is the most frequent flake since #21624. Examples: [run 41946839177 / job 126989027692](https://github.com/microsoft/aspire/actions/runs/41946839177/job/126989027692) (Linux), [run 41967348150 / job 127053704182](https://github.com/microsoft/aspire/actions/runs/41967348150/job/127053704182) (Windows, main), [run 41980257054 / job 127096573746](https://github.com/microsoft/aspire/actions/runs/41980257054/job/127096573746) (Windows). #21796 lists more. ## 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 | `Expected e2e-worker to expose an endpoint URL.` | | Job | VS Code extension E2E (Linux + Windows, tree-actions) | | main pushes: hits / runs | 8 / 306 (2.61%) | | main pushes, 30d: hits / runs | 8 / 530 (1.51%). The 16 days before the 14d window add 0 hits. | | PR runs: hits / runs | 28 / 1605 (1.74%); 0 PR-caused excluded | | Combined rate | 36 / 1911 = **1.88%** | | Flake check | main: next main run of the job passed 8/8; PR: 24/25 rerun hits passed on rerun (3 never rerun) | | First / last hit | 2026-11-05 / 2026-11-08 | | Still hitting main? | Yes, still active: last hit 2026-11-08; last main hit 2026-11-07 | | Fix evidence | Local real E2E: injected 5s delay 3/3 fail → 3/3 pass; natural run 1/1 pass. This PR's CI: tree-actions Linux and Windows passed 1/1 each. | Failing attempt-1 jobs, most recent first (10 of 34 log-verified hits): | Date (UTC) | Branch | Job | Signature excerpt | |---|---|---|---| | [2026-11-08 06:06](https://github.com/microsoft/aspire/actions/runs/42453400853/job/128650958075) | `aspireagent/vscode-bridge-scoped-fake-timers` | VS Code extension E2E (Windows, tree-actions) | `Expected e2e-worker to expose an endpoint URL.` | | [2026-11-08 05:17](https://github.com/microsoft/aspire/actions/runs/42450180289/job/128641295561) | `darc-main-252ee2c2-deac-4980-a34a-b797f49158de` | VS Code extension E2E (Windows, tree-actions) | `Expected e2e-worker to expose an endpoint URL.` | | [2026-11-08 04:40](https://github.com/microsoft/aspire/actions/runs/42447773687/job/128633232882) | `aspireagent/doctor-cancel-dcp-cleanup` | VS Code extension E2E (Windows, tree-actions) | `Expected e2e-worker to expose an endpoint URL.` | | [2026-11-08 04:32](https://github.com/microsoft/aspire/actions/runs/42447210418/job/128631545572) | `aspireagent/resource-attach-proof-resume-aborted-inspection` | VS Code extension E2E (Windows, tree-actions) | `Expected e2e-worker to expose an endpoint URL.` | | [2026-11-07 21:02](https://github.com/microsoft/aspire/actions/runs/42413947055/job/128538664400) | **main** | VS Code extension E2E (Windows, tree-actions) | `Expected e2e-worker to expose an endpoint URL.` | | [2026-11-07 03:55](https://github.com/microsoft/aspire/actions/runs/42336149573/job/128297445902) | `sebros/resources-compact-view-regression-4abee4` | VS Code extension E2E (Windows, tree-actions) | `Expected e2e-worker to expose an endpoint URL.` | | [2026-11-06 23:20](https://github.com/microsoft/aspire/actions/runs/42311290959/job/128230943448) | **main** | VS Code extension E2E (Windows, tree-actions) | `Expected e2e-worker to expose an endpoint URL.` | | [2026-11-06 22:50](https://github.com/microsoft/aspire/actions/runs/42307718588/job/128210216707) | `ellahathaway-stop-idle-extension-polling` | VS Code extension E2E (Windows, tree-actions) | `Expected e2e-worker to expose an endpoint URL.` | | [2026-11-06 20:25](https://github.com/microsoft/aspire/actions/runs/42288258477/job/128147538335) | **main** | VS Code extension E2E (Linux, tree-actions) | `Expected e2e-worker to expose an endpoint URL.` | | [2026-11-06 20:20](https://github.com/microsoft/aspire/actions/runs/42287581178/job/128143472756) | `ellahathaway-clarify-agent-init-output` | VS Code extension E2E (Windows, tree-actions) | `Expected e2e-worker to expose an endpoint URL.` | A strict re-scan of the job logs confirmed 34 of the 36 hits counted above; the table lists only confirmed hits. The rates above use the original count. **Verdict: STRONG.** The most frequent signature here: 36 hits since 2026-11-05 (8 on main), still hitting today. 24 of the 25 PR hits that were rerun passed on rerun, and all 8 main hits passed on the next main run. The real-E2E before/after repro shows the exact CI assertion. The PR's own CI is 1 run per OS. That is not statistical proof on its own: at a 1.9% rate, ~160 clean runs are needed for 95% confidence. <!-- /failure-stats --> **Why:** the spec captures `e2e-worker` from the first snapshot where it is `Running` and later reads its endpoint URL from that same object. DCP activates the worker's endpoint shortly after the resource reaches `Running`, and the backchannel omits inactive URLs, so the first `Running` snapshot can have `urls: []`. The URL-bearing snapshot arrives a few milliseconds later, but the spec never re-reads it. Since #21624, the worker reaches `Running` after the extension's `describe --follow` attaches, so this URL-less snapshot is now visible to the spec. **Fix:** wait with the existing `waitForRunningResourceWithUrl('e2e-worker', 'http:', 180000)` helper (already used by the Azure Functions spec) instead of `waitForResourceState('e2e-worker', ['Running'])`. This is a test-only change, and the endpoint assertion is unchanged. Fixes #21796 ## Confidence - **Real E2E, paired before/after (Linux, xvfb, real VS Code 1.130.0, CLI/DCP/VSIX/NuGets from main CI run 42413947055):** a local-only CLI wrapper delays the first URL-bearing `Running` `e2e-worker` line from `describe --follow` by 5s. The 5s delay is well above the 200ms state poll interval, so the URL-less snapshot is always observed. - Before (spec on `origin/main`): **3/3 failed** (6 passing, 1 failing), each with the exact CI assertion. - After (this PR): **3/3 passed** (7/7). - **Natural (no injection) run with the fix:** 1/1 passed (7/7). Locally, the URL-bearing `Running` snapshot followed the URL-less one by 2ms. - **Other checks:** eslint on the spec, `tsc` for both `tsconfig.e2e.json` and the unit project, and `e2eResourceReadiness.test.ts` (9/9, run with mocha directly) all pass. - **Not run locally:** the Windows `tree-actions` shard, other E2E shards, and `vscode-test`-hosted unit tests (the VS Code download host is blocked in my environment). CI covers these. **How we stop this recurring:** E2E specs that read resource URLs should wait on `waitForRunningResourceWithUrl` instead of a state-only `Running` gate, because state and URL activation arrive as separate snapshots. Related: #21854 made the same change but was closed without being merged. ## 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 (the change is to an E2E scenario test; the helper it uses already has unit coverage) - [ ] 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 37d2680)
…tions E2E (#21914) ## Description The Linux and Windows `tree-actions` VS Code E2E shard fails with `AssertionError: Expected e2e-worker to expose an endpoint URL.` in *routes view, copy, endpoint, log, and resource commands through tree handlers*. It is the most frequent flake since #21624. Examples: [run 41946839177 / job 126989027692](https://github.com/microsoft/aspire/actions/runs/41946839177/job/126989027692) (Linux), [run 41967348150 / job 127053704182](https://github.com/microsoft/aspire/actions/runs/41967348150/job/127053704182) (Windows, main), [run 41980257054 / job 127096573746](https://github.com/microsoft/aspire/actions/runs/41980257054/job/127096573746) (Windows). #21796 lists more. ## 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 | `Expected e2e-worker to expose an endpoint URL.` | | Job | VS Code extension E2E (Linux + Windows, tree-actions) | | main pushes: hits / runs | 8 / 306 (2.61%) | | main pushes, 30d: hits / runs | 8 / 530 (1.51%). The 16 days before the 14d window add 0 hits. | | PR runs: hits / runs | 28 / 1605 (1.74%); 0 PR-caused excluded | | Combined rate | 36 / 1911 = **1.88%** | | Flake check | main: next main run of the job passed 8/8; PR: 24/25 rerun hits passed on rerun (3 never rerun) | | First / last hit | 2026-11-05 / 2026-11-08 | | Still hitting main? | Yes, still active: last hit 2026-11-08; last main hit 2026-11-07 | | Fix evidence | Local real E2E: injected 5s delay 3/3 fail → 3/3 pass; natural run 1/1 pass. This PR's CI: tree-actions Linux and Windows passed 1/1 each. | Failing attempt-1 jobs, most recent first (10 of 34 log-verified hits): | Date (UTC) | Branch | Job | Signature excerpt | |---|---|---|---| | [2026-11-08 06:06](https://github.com/microsoft/aspire/actions/runs/42453400853/job/128650958075) | `aspireagent/vscode-bridge-scoped-fake-timers` | VS Code extension E2E (Windows, tree-actions) | `Expected e2e-worker to expose an endpoint URL.` | | [2026-11-08 05:17](https://github.com/microsoft/aspire/actions/runs/42450180289/job/128641295561) | `darc-main-252ee2c2-deac-4980-a34a-b797f49158de` | VS Code extension E2E (Windows, tree-actions) | `Expected e2e-worker to expose an endpoint URL.` | | [2026-11-08 04:40](https://github.com/microsoft/aspire/actions/runs/42447773687/job/128633232882) | `aspireagent/doctor-cancel-dcp-cleanup` | VS Code extension E2E (Windows, tree-actions) | `Expected e2e-worker to expose an endpoint URL.` | | [2026-11-08 04:32](https://github.com/microsoft/aspire/actions/runs/42447210418/job/128631545572) | `aspireagent/resource-attach-proof-resume-aborted-inspection` | VS Code extension E2E (Windows, tree-actions) | `Expected e2e-worker to expose an endpoint URL.` | | [2026-11-07 21:02](https://github.com/microsoft/aspire/actions/runs/42413947055/job/128538664400) | **main** | VS Code extension E2E (Windows, tree-actions) | `Expected e2e-worker to expose an endpoint URL.` | | [2026-11-07 03:55](https://github.com/microsoft/aspire/actions/runs/42336149573/job/128297445902) | `sebros/resources-compact-view-regression-4abee4` | VS Code extension E2E (Windows, tree-actions) | `Expected e2e-worker to expose an endpoint URL.` | | [2026-11-06 23:20](https://github.com/microsoft/aspire/actions/runs/42311290959/job/128230943448) | **main** | VS Code extension E2E (Windows, tree-actions) | `Expected e2e-worker to expose an endpoint URL.` | | [2026-11-06 22:50](https://github.com/microsoft/aspire/actions/runs/42307718588/job/128210216707) | `ellahathaway-stop-idle-extension-polling` | VS Code extension E2E (Windows, tree-actions) | `Expected e2e-worker to expose an endpoint URL.` | | [2026-11-06 20:25](https://github.com/microsoft/aspire/actions/runs/42288258477/job/128147538335) | **main** | VS Code extension E2E (Linux, tree-actions) | `Expected e2e-worker to expose an endpoint URL.` | | [2026-11-06 20:20](https://github.com/microsoft/aspire/actions/runs/42287581178/job/128143472756) | `ellahathaway-clarify-agent-init-output` | VS Code extension E2E (Windows, tree-actions) | `Expected e2e-worker to expose an endpoint URL.` | A strict re-scan of the job logs confirmed 34 of the 36 hits counted above; the table lists only confirmed hits. The rates above use the original count. **Verdict: STRONG.** The most frequent signature here: 36 hits since 2026-11-05 (8 on main), still hitting today. 24 of the 25 PR hits that were rerun passed on rerun, and all 8 main hits passed on the next main run. The real-E2E before/after repro shows the exact CI assertion. The PR's own CI is 1 run per OS. That is not statistical proof on its own: at a 1.9% rate, ~160 clean runs are needed for 95% confidence. <!-- /failure-stats --> **Why:** the spec captures `e2e-worker` from the first snapshot where it is `Running` and later reads its endpoint URL from that same object. DCP activates the worker's endpoint shortly after the resource reaches `Running`, and the backchannel omits inactive URLs, so the first `Running` snapshot can have `urls: []`. The URL-bearing snapshot arrives a few milliseconds later, but the spec never re-reads it. Since #21624, the worker reaches `Running` after the extension's `describe --follow` attaches, so this URL-less snapshot is now visible to the spec. **Fix:** wait with the existing `waitForRunningResourceWithUrl('e2e-worker', 'http:', 180000)` helper (already used by the Azure Functions spec) instead of `waitForResourceState('e2e-worker', ['Running'])`. This is a test-only change, and the endpoint assertion is unchanged. Fixes #21796 ## Confidence - **Real E2E, paired before/after (Linux, xvfb, real VS Code 1.130.0, CLI/DCP/VSIX/NuGets from main CI run 42413947055):** a local-only CLI wrapper delays the first URL-bearing `Running` `e2e-worker` line from `describe --follow` by 5s. The 5s delay is well above the 200ms state poll interval, so the URL-less snapshot is always observed. - Before (spec on `origin/main`): **3/3 failed** (6 passing, 1 failing), each with the exact CI assertion. - After (this PR): **3/3 passed** (7/7). - **Natural (no injection) run with the fix:** 1/1 passed (7/7). Locally, the URL-bearing `Running` snapshot followed the URL-less one by 2ms. - **Other checks:** eslint on the spec, `tsc` for both `tsconfig.e2e.json` and the unit project, and `e2eResourceReadiness.test.ts` (9/9, run with mocha directly) all pass. - **Not run locally:** the Windows `tree-actions` shard, other E2E shards, and `vscode-test`-hosted unit tests (the VS Code download host is blocked in my environment). CI covers these. **How we stop this recurring:** E2E specs that read resource URLs should wait on `waitForRunningResourceWithUrl` instead of a state-only `Running` gate, because state and URL activation arrive as separate snapshots. Related: #21854 made the same change but was closed without being merged. ## 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 (the change is to an E2E scenario test; the helper it uses already has unit coverage) - [ ] 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 37d2680)
…tions E2E (#21914) ## Description The Linux and Windows `tree-actions` VS Code E2E shard fails with `AssertionError: Expected e2e-worker to expose an endpoint URL.` in *routes view, copy, endpoint, log, and resource commands through tree handlers*. It is the most frequent flake since #21624. Examples: [run 41946839177 / job 126989027692](https://github.com/microsoft/aspire/actions/runs/41946839177/job/126989027692) (Linux), [run 41967348150 / job 127053704182](https://github.com/microsoft/aspire/actions/runs/41967348150/job/127053704182) (Windows, main), [run 41980257054 / job 127096573746](https://github.com/microsoft/aspire/actions/runs/41980257054/job/127096573746) (Windows). #21796 lists more. ## 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 | `Expected e2e-worker to expose an endpoint URL.` | | Job | VS Code extension E2E (Linux + Windows, tree-actions) | | main pushes: hits / runs | 8 / 306 (2.61%) | | main pushes, 30d: hits / runs | 8 / 530 (1.51%). The 16 days before the 14d window add 0 hits. | | PR runs: hits / runs | 28 / 1605 (1.74%); 0 PR-caused excluded | | Combined rate | 36 / 1911 = **1.88%** | | Flake check | main: next main run of the job passed 8/8; PR: 24/25 rerun hits passed on rerun (3 never rerun) | | First / last hit | 2026-11-05 / 2026-11-08 | | Still hitting main? | Yes, still active: last hit 2026-11-08; last main hit 2026-11-07 | | Fix evidence | Local real E2E: injected 5s delay 3/3 fail → 3/3 pass; natural run 1/1 pass. This PR's CI: tree-actions Linux and Windows passed 1/1 each. | Failing attempt-1 jobs, most recent first (10 of 34 log-verified hits): | Date (UTC) | Branch | Job | Signature excerpt | |---|---|---|---| | [2026-11-08 06:06](https://github.com/microsoft/aspire/actions/runs/42453400853/job/128650958075) | `aspireagent/vscode-bridge-scoped-fake-timers` | VS Code extension E2E (Windows, tree-actions) | `Expected e2e-worker to expose an endpoint URL.` | | [2026-11-08 05:17](https://github.com/microsoft/aspire/actions/runs/42450180289/job/128641295561) | `darc-main-252ee2c2-deac-4980-a34a-b797f49158de` | VS Code extension E2E (Windows, tree-actions) | `Expected e2e-worker to expose an endpoint URL.` | | [2026-11-08 04:40](https://github.com/microsoft/aspire/actions/runs/42447773687/job/128633232882) | `aspireagent/doctor-cancel-dcp-cleanup` | VS Code extension E2E (Windows, tree-actions) | `Expected e2e-worker to expose an endpoint URL.` | | [2026-11-08 04:32](https://github.com/microsoft/aspire/actions/runs/42447210418/job/128631545572) | `aspireagent/resource-attach-proof-resume-aborted-inspection` | VS Code extension E2E (Windows, tree-actions) | `Expected e2e-worker to expose an endpoint URL.` | | [2026-11-07 21:02](https://github.com/microsoft/aspire/actions/runs/42413947055/job/128538664400) | **main** | VS Code extension E2E (Windows, tree-actions) | `Expected e2e-worker to expose an endpoint URL.` | | [2026-11-07 03:55](https://github.com/microsoft/aspire/actions/runs/42336149573/job/128297445902) | `sebros/resources-compact-view-regression-4abee4` | VS Code extension E2E (Windows, tree-actions) | `Expected e2e-worker to expose an endpoint URL.` | | [2026-11-06 23:20](https://github.com/microsoft/aspire/actions/runs/42311290959/job/128230943448) | **main** | VS Code extension E2E (Windows, tree-actions) | `Expected e2e-worker to expose an endpoint URL.` | | [2026-11-06 22:50](https://github.com/microsoft/aspire/actions/runs/42307718588/job/128210216707) | `ellahathaway-stop-idle-extension-polling` | VS Code extension E2E (Windows, tree-actions) | `Expected e2e-worker to expose an endpoint URL.` | | [2026-11-06 20:25](https://github.com/microsoft/aspire/actions/runs/42288258477/job/128147538335) | **main** | VS Code extension E2E (Linux, tree-actions) | `Expected e2e-worker to expose an endpoint URL.` | | [2026-11-06 20:20](https://github.com/microsoft/aspire/actions/runs/42287581178/job/128143472756) | `ellahathaway-clarify-agent-init-output` | VS Code extension E2E (Windows, tree-actions) | `Expected e2e-worker to expose an endpoint URL.` | A strict re-scan of the job logs confirmed 34 of the 36 hits counted above; the table lists only confirmed hits. The rates above use the original count. **Verdict: STRONG.** The most frequent signature here: 36 hits since 2026-11-05 (8 on main), still hitting today. 24 of the 25 PR hits that were rerun passed on rerun, and all 8 main hits passed on the next main run. The real-E2E before/after repro shows the exact CI assertion. The PR's own CI is 1 run per OS. That is not statistical proof on its own: at a 1.9% rate, ~160 clean runs are needed for 95% confidence. <!-- /failure-stats --> **Why:** the spec captures `e2e-worker` from the first snapshot where it is `Running` and later reads its endpoint URL from that same object. DCP activates the worker's endpoint shortly after the resource reaches `Running`, and the backchannel omits inactive URLs, so the first `Running` snapshot can have `urls: []`. The URL-bearing snapshot arrives a few milliseconds later, but the spec never re-reads it. Since #21624, the worker reaches `Running` after the extension's `describe --follow` attaches, so this URL-less snapshot is now visible to the spec. **Fix:** wait with the existing `waitForRunningResourceWithUrl('e2e-worker', 'http:', 180000)` helper (already used by the Azure Functions spec) instead of `waitForResourceState('e2e-worker', ['Running'])`. This is a test-only change, and the endpoint assertion is unchanged. Fixes #21796 ## Confidence - **Real E2E, paired before/after (Linux, xvfb, real VS Code 1.130.0, CLI/DCP/VSIX/NuGets from main CI run 42413947055):** a local-only CLI wrapper delays the first URL-bearing `Running` `e2e-worker` line from `describe --follow` by 5s. The 5s delay is well above the 200ms state poll interval, so the URL-less snapshot is always observed. - Before (spec on `origin/main`): **3/3 failed** (6 passing, 1 failing), each with the exact CI assertion. - After (this PR): **3/3 passed** (7/7). - **Natural (no injection) run with the fix:** 1/1 passed (7/7). Locally, the URL-bearing `Running` snapshot followed the URL-less one by 2ms. - **Other checks:** eslint on the spec, `tsc` for both `tsconfig.e2e.json` and the unit project, and `e2eResourceReadiness.test.ts` (9/9, run with mocha directly) all pass. - **Not run locally:** the Windows `tree-actions` shard, other E2E shards, and `vscode-test`-hosted unit tests (the VS Code download host is blocked in my environment). CI covers these. **How we stop this recurring:** E2E specs that read resource URLs should wait on `waitForRunningResourceWithUrl` instead of a state-only `Running` gate, because state and URL activation arrive as separate snapshots. Related: #21854 made the same change but was closed without being merged. ## 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 (the change is to an E2E scenario test; the helper it uses already has unit coverage) - [ ] 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 37d2680)
Description
Fixes the VS Code Linux E2E
tree-actionsflake ("could not find a matching endpoint" and "Timed out waiting for resource 'e2e-terminal' state Running"), tracked in #19282 and #21600.Root cause
The E2E VS Code has no C# extension, so
DEBUG_SESSION_INFOadvertises an explicit capability list that contains neitherprojectnorproject-with-external-build.v1.SupportsDebugginghonours that list strictly, so DCP runse2e-workerande2e-terminalas plain processes. However,DotnetProjectBuildCoordinator.ShouldCoordinateBuildcoordinated the build in a debug session only whenproject-with-external-build.v1was advertised. As a result there was no coordinated build andSuppressBuildstayed false. Both resources, which shareAspireE2E.Worker.csproj(a Web SDK project), each randotnet run --project … --configuration Debug --no-launch-profileat about the same time, so the cold project was built twice concurrently. One build can fail on a file the other holds open inobj/. That resource then exits right after reaching Running, so the tree has no URL (or the resource never stays Running).CI evidence (attempt-1 diagnostics artifacts, CLI log
aspire-home/logs/cli_*.log):e2e-workerwas started viadotnet runat 15:34:42.789 ande2e-terminalviadotnet runat 15:34:42.976, both on the same csproj.e2e-workerwent Running → Finished at 15:34:47.117, and the test failed with "could not find a matching endpoint".dotnet runpattern, but heree2e-terminalwent Running → Finished about 4s later, so the test timed out waiting for the e2e-terminal state Running.Local reproduction: two concurrent
dotnet runs of one cold Web csproj, started 190ms apart. In 4 of 6 trials one run exited 1 withIOException: The process cannot access the file '…/obj/Debug/net10.0/rjsmrazor.dswa.cache.json' because it is being used by another process(StaticWebAssets).Frequency
Window: ci.yml runs created 2026-10-29T00:45Z to 2026-11-01T00:45Z (72h, 489 runs), attempt-1 jobs only.
tree-actions: 4/253 failures have this root cause (about 1.6%). That is 0/29 on main and 4/224 on PR branches, spread over 4 distinct branches: 2× "could not find a matching endpoint" and 2× e2e-terminal Running timeout. The other 3 failures in the window had unrelated signatures.Fix
ShouldCoordinateBuildnow also coordinates when the IDE sends an explicit capability list withoutproject. Those resources run as DCP processes exactly as they do outside an IDE, so they get the single coordinated build and launch from the built output withSuppressBuild. Behaviour is unchanged for:project-with-external-build.v1(coordinated);projectwithout external build (legacy; the IDE owns the build).No sleeps, retries, assertion changes or test disabling.
The Session 2 build-ownership contract in
docs/plans/project-v2-csharpprogram-watch.mdnow lists this rule alongside the existing ones. It keeps the qualifications for older/capability-less launchers and for persistent lifetime. The race explanation above stays here, not in the plan doc.Tests
DotnetProjectBuildCoordinatorTests.DebugSessionWithoutProjectCapabilityCoordinatesBuildForProcessLaunches(theory: an empty list, andnode,browser). Two resources share a project, and the test asserts oneDotnetProjectBuildResource,SuppressBuild, and a build-completion annotation per resource. Fails before the fix in both cases (Assert.Single() Failure: The collection was empty) and passes after.Aspire.Hosting.Dotnet.Testsand all 30BlazorHostedExtensionsTests(including the browser-only debug session) pass locally. Some DCP/real-build tests inAspire.Hosting.Dotnet.Teststimed out locally because of the sandbox environment (no network or DCP). None of them sets a debug session, so this change does not affect them; CI covers them.cli_20261101T014747_185e943c.log) shows__dotnet-project-buildrunning a singledotnet build …/obj/.aspire/build/projects.41c8f414a9ec.proj(Running → Finished 01:47:50.9 → 01:47:53.35).e2e-workerande2e-terminalthen go Starting → Waiting until that build completes, and launch directly fromAspireE2E.Worker/bin/Debug/net10.0/AspireE2E.Worker. There are 0run --projectinvocations, versus two concurrentdotnet run --projectbuilds in the failing runs.Confidence
High for the root cause and the fix. CI logs from the failing runs show two concurrent
dotnet run --projectbuilds of the shared csproj. A local repro reproduces theobj/file-lock failure in 4 of 6 trials. The new unit test fails before the fix and passes after. A real VS Code E2E run on the fix shows a single coordinated build and nodotnet run --project. The main uncertainty: one passing E2E run does not prove the 1.6% flake is gone. Tracking the Linuxtree-actionsfailure rate after merge will confirm it.How we stop this recurring: the build-coordination decision is now pinned by
DebugSessionWithoutProjectCapabilityCoordinatesBuildForProcessLaunches. That test fails if a debug session that launches project resources as DCP processes stops getting the single coordinated build.Checklist
🤖 Posted by AspireAgent (AI Agent)