Repository navigation
Fix VS Code E2E folder picker flake after a colliding selection - #21926
David Fowler (davidfowl) merged 1 commit into
Conversation
The workspace-target-proof colliding-selection test typed a path into VS Code's simple file dialog and pressed Enter immediately. If Enter arrives while the dialog is still navigating to the typed path's parent, the dialog consumes Enter to refresh its listing and never resolves, so the expected collision notification never appears. Add answerActiveSimpleFileDialog, which waits for the initial listing, types the path, and confirms only once the dialog shows the typed path and its parent folder listing. 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 -- 21926Or
iex "& { $(irm https://raw.githubusercontent.com/microsoft/aspire/main/eng/scripts/get-aspire-cli-pr.ps1) } 21926" |
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.
🟢 Approval recommended
No active review issues block approval of the test-only folder-picker timing fix.
No open issues 🎉
What changed in this PR
This test-only change addresses a folder-picker timing race in the VS Code extension’s workspace-target E2E scenario. It waits for the simple file dialog’s listing to settle before confirming a selection, without changing product behavior or weakening assertions.
Changes:
- Add
answerActiveSimpleFileDialogto wait for initial loading and the expected path/listing before pressing Enter. - Use the helper for both the colliding and valid folder selections.
- Expose
getText()on the testInputBoxinterface.
| File | Description |
|---|---|
extension/src/test-e2e/workspaceTargetProof.e2e.test.ts |
Use the dialog-specific helper for both folder selections. |
extension/src/test-e2e/helpers/vscode.ts |
Add state-based waits before confirming the simple file dialog. |
extension/src/test-e2e/helpers/extester.ts |
Add the input-text accessor needed by the helper. |
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. |
|
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 → test_only. No signals triggered. All 3 changed files match |
## Description **What failed:** `Workspace target proof E2E › reopens the project folder picker after a colliding selection` timed out on attempt 1 in VS Code extension E2E (Linux, workspace-target-proof): [run 40807158783 / job 123237221153](https://github.com/microsoft/aspire/actions/runs/40807158783/job/123237221153). The test waited for the notification `The output directory '…/colliding-parent/aspire-empty' already exists and is not empty…`, which never appeared. In the failure screenshot, the folder picker is still open with the typed path and the parent listing (`..`, `colliding-parent`, `valid-parent`). The extension log shows `promptForFilePath` never returned, and it was cancelled at teardown. ## 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 | `reopens the project folder picker after a colliding selection` timeout | | Job | VS Code extension E2E (Linux, workspace-target-proof) | | 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 | 3 / 816 (0.37%); 3 PR-caused excluded | | Combined rate | 3 / 969 = **0.31%** | | Flake check | PR: 3/3 rerun hits passed on rerun (0 never rerun) | | First / last hit | 2026-10-28 / 2026-10-29 | | Still hitting main? | Last main hit: never. 123 main runs since the last hit (2026-10-29), with 0 hits | | Fix evidence | Local: forced-race spec 3/3 fail → 3/3 pass. The full shard passed 3/3, but the unmodified baseline also passed 2/2. This PR's CI: workspace-target-proof passed 3/3 attempts on the head commit. | Failing attempt-1 jobs, most recent first (6 of 6 log-verified hits, including PR-caused ones marked excluded): | Date (UTC) | Branch | Job | Signature excerpt | |---|---|---|---| | [2026-10-29 19:11](https://github.com/microsoft/aspire/actions/runs/40937836793/job/123684689037) | `danegsta-nuget-mapping-regression` (PR-caused, excluded) | VS Code extension E2E (Linux, workspace-target-proof) | `reopens the project folder picker after a colliding selection: TimeoutError: Timed out waiting for the generated AppHost…` | | [2026-10-29 02:34](https://github.com/microsoft/aspire/actions/runs/40807158783/job/123237221153) | `jamesnk/configurable-integration-sources` | VS Code extension E2E (Linux, workspace-target-proof) | `reopens the project folder picker after a colliding selection: TimeoutError: Timed out waiting for notification containi…` | | [2026-10-29 00:30](https://github.com/microsoft/aspire/actions/runs/40794520210/job/123195193042) | `danegsta-nuget-mapping-regression` (PR-caused, excluded) | VS Code extension E2E (Linux, workspace-target-proof) | `reopens the project folder picker after a colliding selection: TimeoutError: Timed out waiting for the generated AppHost…` | | [2026-10-28 23:37](https://github.com/microsoft/aspire/actions/runs/40788634670/job/123175977606) | `dependabot/npm_and_yarn/playground/AspireWithJavaScript/AspireJavaScript.Angular/npm_and_yarn-b95ee0e95b` | VS Code extension E2E (Linux, workspace-target-proof) | `reopens the project folder picker after a colliding selection: TimeoutError: Timed out waiting for quick pick 'No'. Visi…` | | [2026-10-28 20:53](https://github.com/microsoft/aspire/actions/runs/40767263273/job/123106717682) | `danegsta-nuget-mapping-regression` (PR-caused, excluded) | VS Code extension E2E (Linux, workspace-target-proof) | `reopens the project folder picker after a colliding selection: TimeoutError: Timed out waiting for the generated AppHost…` | | [2026-10-28 01:32](https://github.com/microsoft/aspire/actions/runs/40615656113/job/122583915112) | `mitchdenny-existing-aks-environments` | VS Code extension E2E (Linux, workspace-target-proof) | `reopens the project folder picker after a colliding selection: TimeoutError: Timed out waiting for quick pick 'No'. Visi…` | **Verdict: WEAK.** 3 non-PR-caused hits, **never on main**, all on 2026-10-28/29 and all passed on rerun. Another 3 hits on `danegsta-nuget-mapping-regression` failed on all 4 attempts and are excluded as PR-caused. Since 2026-10-29 there are **0 hits** in 123 main runs and the following PR runs, so it may already be gone or be very rare. <!-- /failure-stats --> **Why:** The test enables `files.simpleDialog.enable`. That dialog navigates asynchronously as the path is typed (`handleValueChange` → `tryUpdateItems` → `fileService.stat` → `updateItems`). The old helper typed the path and pressed Enter straight away. If Enter arrives before that navigation finishes, `onDidAccept` runs `tryUpdateItems` itself, sees that the listing changed, and returns without resolving ("If the items have updated, don't try to resolve"). Enter is consumed, and the dialog stays open forever. **Fix:** Add a test helper, `answerActiveSimpleFileDialog`, and use it for both folder answers. The helper: - waits for the dialog's initial listing to load, so the initial navigation can't overwrite the typed text; - types the path; - presses Enter only once the input shows the typed path and the listing shows that folder, meaning navigation has finished. This is test-only. There are no product changes, no added sleeps or retries, and no weakened assertions. ## Confidence - **Before (forced race):** A temporary local spec reproduced the race deterministically by typing the path and pressing Enter in a single `sendKeys`. It failed **3/3** with the CI signature: the same notification timeout, and the dialog left open with the typed path and parent listing. - **After:** The same temporary spec using `answerActiveSimpleFileDialog` passed **3/3**. - The full `workspace-target-proof` shard with this change passed **3/3** locally (VS Code 1.130.0, xvfb, CLI/DCP/nugets from main CI artifacts). An unmodified baseline also passed 2/2, so the flake is intermittent rather than consistent. - `yarn compile-e2e` and `eslint` pass on the touched files. - **Not run:** other E2E shards, macOS/Windows, and the extension unit tests. Only E2E helpers changed, and no other test uses the simple file dialog. **How we stop this recurring:** Tests that drive VS Code's simple file dialog should use `answerActiveSimpleFileDialog`, not `answerActiveInput`. The helper's comment explains the race. Refs #19282 (there is no dedicated issue for this flake). ## 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 (E2E test fix) - [ ] 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 2f471dc)
## Description **What failed:** `Workspace target proof E2E › reopens the project folder picker after a colliding selection` timed out on attempt 1 in VS Code extension E2E (Linux, workspace-target-proof): [run 40807158783 / job 123237221153](https://github.com/microsoft/aspire/actions/runs/40807158783/job/123237221153). The test waited for the notification `The output directory '…/colliding-parent/aspire-empty' already exists and is not empty…`, which never appeared. In the failure screenshot, the folder picker is still open with the typed path and the parent listing (`..`, `colliding-parent`, `valid-parent`). The extension log shows `promptForFilePath` never returned, and it was cancelled at teardown. ## 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 | `reopens the project folder picker after a colliding selection` timeout | | Job | VS Code extension E2E (Linux, workspace-target-proof) | | 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 | 3 / 816 (0.37%); 3 PR-caused excluded | | Combined rate | 3 / 969 = **0.31%** | | Flake check | PR: 3/3 rerun hits passed on rerun (0 never rerun) | | First / last hit | 2026-10-28 / 2026-10-29 | | Still hitting main? | Last main hit: never. 123 main runs since the last hit (2026-10-29), with 0 hits | | Fix evidence | Local: forced-race spec 3/3 fail → 3/3 pass. The full shard passed 3/3, but the unmodified baseline also passed 2/2. This PR's CI: workspace-target-proof passed 3/3 attempts on the head commit. | Failing attempt-1 jobs, most recent first (6 of 6 log-verified hits, including PR-caused ones marked excluded): | Date (UTC) | Branch | Job | Signature excerpt | |---|---|---|---| | [2026-10-29 19:11](https://github.com/microsoft/aspire/actions/runs/40937836793/job/123684689037) | `danegsta-nuget-mapping-regression` (PR-caused, excluded) | VS Code extension E2E (Linux, workspace-target-proof) | `reopens the project folder picker after a colliding selection: TimeoutError: Timed out waiting for the generated AppHost…` | | [2026-10-29 02:34](https://github.com/microsoft/aspire/actions/runs/40807158783/job/123237221153) | `jamesnk/configurable-integration-sources` | VS Code extension E2E (Linux, workspace-target-proof) | `reopens the project folder picker after a colliding selection: TimeoutError: Timed out waiting for notification containi…` | | [2026-10-29 00:30](https://github.com/microsoft/aspire/actions/runs/40794520210/job/123195193042) | `danegsta-nuget-mapping-regression` (PR-caused, excluded) | VS Code extension E2E (Linux, workspace-target-proof) | `reopens the project folder picker after a colliding selection: TimeoutError: Timed out waiting for the generated AppHost…` | | [2026-10-28 23:37](https://github.com/microsoft/aspire/actions/runs/40788634670/job/123175977606) | `dependabot/npm_and_yarn/playground/AspireWithJavaScript/AspireJavaScript.Angular/npm_and_yarn-b95ee0e95b` | VS Code extension E2E (Linux, workspace-target-proof) | `reopens the project folder picker after a colliding selection: TimeoutError: Timed out waiting for quick pick 'No'. Visi…` | | [2026-10-28 20:53](https://github.com/microsoft/aspire/actions/runs/40767263273/job/123106717682) | `danegsta-nuget-mapping-regression` (PR-caused, excluded) | VS Code extension E2E (Linux, workspace-target-proof) | `reopens the project folder picker after a colliding selection: TimeoutError: Timed out waiting for the generated AppHost…` | | [2026-10-28 01:32](https://github.com/microsoft/aspire/actions/runs/40615656113/job/122583915112) | `mitchdenny-existing-aks-environments` | VS Code extension E2E (Linux, workspace-target-proof) | `reopens the project folder picker after a colliding selection: TimeoutError: Timed out waiting for quick pick 'No'. Visi…` | **Verdict: WEAK.** 3 non-PR-caused hits, **never on main**, all on 2026-10-28/29 and all passed on rerun. Another 3 hits on `danegsta-nuget-mapping-regression` failed on all 4 attempts and are excluded as PR-caused. Since 2026-10-29 there are **0 hits** in 123 main runs and the following PR runs, so it may already be gone or be very rare. <!-- /failure-stats --> **Why:** The test enables `files.simpleDialog.enable`. That dialog navigates asynchronously as the path is typed (`handleValueChange` → `tryUpdateItems` → `fileService.stat` → `updateItems`). The old helper typed the path and pressed Enter straight away. If Enter arrives before that navigation finishes, `onDidAccept` runs `tryUpdateItems` itself, sees that the listing changed, and returns without resolving ("If the items have updated, don't try to resolve"). Enter is consumed, and the dialog stays open forever. **Fix:** Add a test helper, `answerActiveSimpleFileDialog`, and use it for both folder answers. The helper: - waits for the dialog's initial listing to load, so the initial navigation can't overwrite the typed text; - types the path; - presses Enter only once the input shows the typed path and the listing shows that folder, meaning navigation has finished. This is test-only. There are no product changes, no added sleeps or retries, and no weakened assertions. ## Confidence - **Before (forced race):** A temporary local spec reproduced the race deterministically by typing the path and pressing Enter in a single `sendKeys`. It failed **3/3** with the CI signature: the same notification timeout, and the dialog left open with the typed path and parent listing. - **After:** The same temporary spec using `answerActiveSimpleFileDialog` passed **3/3**. - The full `workspace-target-proof` shard with this change passed **3/3** locally (VS Code 1.130.0, xvfb, CLI/DCP/nugets from main CI artifacts). An unmodified baseline also passed 2/2, so the flake is intermittent rather than consistent. - `yarn compile-e2e` and `eslint` pass on the touched files. - **Not run:** other E2E shards, macOS/Windows, and the extension unit tests. Only E2E helpers changed, and no other test uses the simple file dialog. **How we stop this recurring:** Tests that drive VS Code's simple file dialog should use `answerActiveSimpleFileDialog`, not `answerActiveInput`. The helper's comment explains the race. Refs #19282 (there is no dedicated issue for this flake). ## 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 (E2E test fix) - [ ] 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 2f471dc)
Description
What failed:
Workspace target proof E2E › reopens the project folder picker after a colliding selectiontimed out on attempt 1 in VS Code extension E2E (Linux, workspace-target-proof): run 40807158783 / job 123237221153. The test waited for the notificationThe output directory '…/colliding-parent/aspire-empty' already exists and is not empty…, which never appeared. In the failure screenshot, the folder picker is still open with the typed path and the parent listing (..,colliding-parent,valid-parent). The extension log showspromptForFilePathnever returned, and it was cancelled at teardown.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.reopens the project folder picker after a colliding selectiontimeoutFailing attempt-1 jobs, most recent first (6 of 6 log-verified hits, including PR-caused ones marked excluded):
danegsta-nuget-mapping-regression(PR-caused, excluded)reopens the project folder picker after a colliding selection: TimeoutError: Timed out waiting for the generated AppHost…jamesnk/configurable-integration-sourcesreopens the project folder picker after a colliding selection: TimeoutError: Timed out waiting for notification containi…danegsta-nuget-mapping-regression(PR-caused, excluded)reopens the project folder picker after a colliding selection: TimeoutError: Timed out waiting for the generated AppHost…dependabot/npm_and_yarn/playground/AspireWithJavaScript/AspireJavaScript.Angular/npm_and_yarn-b95ee0e95breopens the project folder picker after a colliding selection: TimeoutError: Timed out waiting for quick pick 'No'. Visi…danegsta-nuget-mapping-regression(PR-caused, excluded)reopens the project folder picker after a colliding selection: TimeoutError: Timed out waiting for the generated AppHost…mitchdenny-existing-aks-environmentsreopens the project folder picker after a colliding selection: TimeoutError: Timed out waiting for quick pick 'No'. Visi…Verdict: WEAK. 3 non-PR-caused hits, never on main, all on 2026-10-28/29 and all passed on rerun. Another 3 hits on
danegsta-nuget-mapping-regressionfailed on all 4 attempts and are excluded as PR-caused. Since 2026-10-29 there are 0 hits in 123 main runs and the following PR runs, so it may already be gone or be very rare.Why: The test enables
files.simpleDialog.enable. That dialog navigates asynchronously as the path is typed (handleValueChange→tryUpdateItems→fileService.stat→updateItems). The old helper typed the path and pressed Enter straight away. If Enter arrives before that navigation finishes,onDidAcceptrunstryUpdateItemsitself, sees that the listing changed, and returns without resolving ("If the items have updated, don't try to resolve"). Enter is consumed, and the dialog stays open forever.Fix: Add a test helper,
answerActiveSimpleFileDialog, and use it for both folder answers. The helper:This is test-only. There are no product changes, no added sleeps or retries, and no weakened assertions.
Confidence
sendKeys. It failed 3/3 with the CI signature: the same notification timeout, and the dialog left open with the typed path and parent listing.answerActiveSimpleFileDialogpassed 3/3.workspace-target-proofshard with this change passed 3/3 locally (VS Code 1.130.0, xvfb, CLI/DCP/nugets from main CI artifacts). An unmodified baseline also passed 2/2, so the flake is intermittent rather than consistent.yarn compile-e2eandeslintpass on the touched files.How we stop this recurring: Tests that drive VS Code's simple file dialog should use
answerActiveSimpleFileDialog, notanswerActiveInput. The helper's comment explains the race.Refs #19282 (there is no dedicated issue for this flake).
Checklist
🤖 Posted by AspireAgent (AI Agent)