Skip to content

[release/17.0] Give the VS Code extension's aspire --version probe a 30s budget - #22033

Closed
Mitch Denny (mitchdenny) wants to merge 1 commit into
mitchdenny-backport-17-0-35-pr21923from
mitchdenny-backport-17-0-36-pr21912
Closed

Mitch Denny (mitchdenny) wants to merge 1 commit into
mitchdenny-backport-17-0-35-pr21923from
mitchdenny-backport-17-0-36-pr21912

Conversation

@mitchdenny

Copy link
Copy Markdown
Member

Description

Backport of #21912 to release/17.0 (cherry-picked from cd3fec7 with no modifications). Layer 36 of 55 in the release/17.0 backport stack; stacked on #22032.

Backport recommendation: No — Extension code ships from main.

Validation: Stable patch IDs match (687f29981eb659615d31f5b122b7a3f0d61db1dc). Builds/tests not run for this unchanged cherry-pick.

Backport of #21912

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
      • If yes, did you have an API Review for it?
        • Yes
        • No
      • Did you add <remarks /> and <code /> elements on your triple slash comments?
        • Yes
        • No
    • No
  • Does the change make any security assumptions or guarantees?
    • Yes
      • If yes, have you done a threat model and had a security review?
        • Yes
        • No
    • No

)

## Description

**What failed:** On `main`, the Windows VS Code extension E2E jobs in
[run
41503655043](https://github.com/microsoft/aspire/actions/runs/41503655043)
failed: the
[browser-debugger](https://github.com/microsoft/aspire/actions/runs/41503655043/job/125489102962)
job's Blazor "maps managed Edge debugging" before-all hook timed out
waiting for `standalone` to reach Running, and the
[apphost-tree](https://github.com/microsoft/aspire/actions/runs/41503655043/job/125489102839)
job hit the tree-actions "secondary AppHost" probe flake. The extension
log shows `E2E CLI path is invalid` followed by `Configured CLI path is
invalid`, about 1.2s after the CLI's first log write, which itself
arrived about 5s after launch.

## 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 | Blazor `"before all" hook for "maps managed Edge
debugging…"` timing out on `standalone` Running **and** the first
`aspire-vscode.debugAppHost` invocation `canceled` (the CLI was
rejected). The `E2E CLI path is invalid` line is only in the
extension-log artifact, not the job log, so the canceled launch is used
as a proxy |
| Job | VS Code extension E2E (Windows, browser-debugger) |
| main pushes: hits / runs | 1 / 153 (0.65%) |
| main pushes, 30d: hits / runs | 1 / 265 (0.38%). The 16 days before
the 14d window add 0 hits. |
| PR runs: hits / runs | 0 / 788 (0.00%); 0 PR-caused excluded |
| Combined rate | 1 / 941 = **0.11%** |
| Flake check | main: next main run of the job passed 1/1 |
| First / last hit | 2026-11-02 / 2026-11-02 |
| Still hitting main? | Last main hit: 2026-11-02. 78 main runs since
the last hit (2026-11-02), with 0 hits |
| Fix evidence | Local: a new real-process test (6s startup stall) fails
before and passes after (single runs). This PR's CI: browser-debugger
(Windows) passed 1/1. |

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

| Date (UTC) | Branch | Job | Signature excerpt |
|---|---|---|---|
| [2026-11-02
18:46](https://github.com/microsoft/aspire/actions/runs/41503655043/job/125489102962)
| **main** | VS Code extension E2E (Windows, browser-debugger) | `Timed
out after 570124ms waiting for resource 'standalone' state Running` |

**Verdict: WEAK.** Only **1 hit** (main, 2026-11-02), matched through a
proxy signature. 78 main runs since then were clean. The other 11
before-all timeouts in this window are different: 8 are the `c:\` casing
bug fixed by #21623 and 3 show a successful launch.

<!-- /failure-stats -->

**Why:** `tryExecuteCli` (`extension/src/utils/cliPath.ts`) validates a
CLI by running `aspire --version` with a hard-coded **5s** timeout. When
a runner stall delays a valid CLI's startup past 5s, the probe rejects
it as invalid and the extension falls back or fails.
`configInfoProvider` already gives the same `aspire --version` command a
30s budget.

**Fix:** Move the named `cliVersionProbeTimeoutMs = 30_000` into
`cliPath.ts`, use it in `tryExecuteCli`, and import it in
`configInfoProvider` so both `--version` probes share one budget. A
probe still has to complete successfully. It does not accept a CLI that
hangs or exits with a non-zero code.

Of the 11 attempt-1 failures of the Blazor before-all hook in the last 7
days, 8 were the `c:\` casing issue that #21623 already fixed, 1 was a
DCP infrastructure timeout and 1 was on a spike branch. The remaining
hit is the one this PR fixes.

## Confidence

- New test `tryExecuteCli accepts a real CLI whose --version output is
delayed by a startup stall` launches a real script that sleeps 6s before
printing a version. On a POSIX runner it uses a `sh` script, and on
Windows a `.cmd` script.
  - **Before** (fix reverted, test kept): fails with `false !== true`.
  - **After**: passes (about 6.0s).
- The existing cmd-shim probe test now asserts the shared constant.
- `tsc` (`compile-tests`) and `eslint` pass on the changed files.
- **Not run:** the full `vscode-test` (Electron) suite and the E2E
suites. The sandbox can't resolve `update.code.visualstudio.com`.
Instead, I ran the compiled `cliPath` and `configInfoProvider` mocha
suites with a stubbed `vscode` module. With the stub, 25 tests that need
real VS Code workspace APIs fail on both unmodified `main` and this
branch, and the failing set is identical. CI covers the rest.

**How we stop this recurring:** Both `aspire --version` probes now share
one named budget, so they can't drift apart again. The real-process test
fails if the probe budget is cut back below a realistic startup stall.

Refs #21600

## 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 <95136+davidfowl@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
(cherry picked from commit cd3fec7)
@github-actions

This comment has been minimized.

@mitchdenny
Mitch Denny (mitchdenny) force-pushed the mitchdenny-backport-17-0-36-pr21912 branch from 7841211 to e7a0410 Compare November 10, 2026 04:23
@mitchdenny
Mitch Denny (mitchdenny) force-pushed the mitchdenny-backport-17-0-36-pr21912 branch from e7a0410 to 7841211 Compare November 10, 2026 04:25
@github-actions

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 -- 22033

Or

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

@mitchdenny

Copy link
Copy Markdown
Member Author

Approved for inclusion in release/17.0. Do not merge yet.

@github-actions

This comment has been minimized.

@mitchdenny
Mitch Denny (mitchdenny) force-pushed the mitchdenny-backport-17-0-36-pr21912 branch from 41208d3 to 7841211 Compare November 10, 2026 06:35
@github-actions

Copy link
Copy Markdown
Contributor

Retrying the failed CI jobs for this pull request from the CI run attempt. The rerun is being tracked in the rerun attempt.

@mitchdenny
Mitch Denny (mitchdenny) force-pushed the mitchdenny-backport-17-0-36-pr21912 branch from 7841211 to 41208d3 Compare November 10, 2026 07:45
@mitchdenny
Mitch Denny (mitchdenny) force-pushed the mitchdenny-backport-17-0-36-pr21912 branch from 41208d3 to 7841211 Compare November 10, 2026 08:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants