Repository navigation
Add regression tests for the SSH probe timeout fix from #21686 - #21627
David Fowler (davidfowl) wants to merge 2 commits into
Conversation
The unattended-SSH verification ran `ssh -V` with a private 5s timeout. A cold first launch of ssh.exe on Windows CI exceeded it, so a working OpenSSH client was reported as "Unattended Git requires a verified OpenSSH executable". This failed GitCommandRunnerTests on main. The probe now uses the caller's acquisition deadline, like every other Git child. A hung probe still ends at that deadline with the Git timeout diagnostic. Contributes to #21600 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
|
🚀 Dogfood this PR with:
curl -fsSL https://raw.githubusercontent.com/microsoft/aspire/main/eng/scripts/get-aspire-cli-pr.sh | bash -s -- 21627Or
iex "& { $(irm https://raw.githubusercontent.com/microsoft/aspire/main/eng/scripts/get-aspire-cli-pr.ps1) } 21627" |
This comment has been minimized.
This comment has been minimized.
There was a problem hiding this comment.
🟢 Approval recommended
No active review issues were identified in the change to caller-controlled SSH probe timeouts.
No open issues 🎉
What changed in this PR
This PR prevents slow-starting OpenSSH clients from being incorrectly rejected during unattended Git operations in the Aspire CLI. It addresses the timeout behavior exposed by inherited configuration-source acquisition.
Changes:
- Removes the private five-second SSH version-probe timeout, relying on caller cancellation and deadlines.
- Adds Unix regression tests for slow startup and cancellation of a hung probe.
- Documents the caller-controlled timeout behavior.
| File | Description |
|---|---|
tests/Aspire.Cli.Tests/Git/GitCommandRunnerTests.Authentication.cs |
Adds fake-SSH tests covering slow startup and caller cancellation. |
src/Aspire.Cli/Git/GitCommandRunner.cs |
Removes the probe-specific timeout while retaining caller cancellation. |
docs/specs/cli-config-sources.md |
Clarifies that OpenSSH verification uses the caller’s operation timeout. |
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 attempt 1 on head
Attempt 2, which reruns the failed jobs, was queued automatically at 03:26:32Z. I made no extra rerun, so these jobs get exactly one rerun. 🤖 Posted by AspireAgent (AI Agent) |
|
Retrying the failed CI jobs for this pull request from the CI run attempt. The rerun is being tracked in the rerun attempt. |
|
CI attempt 2 on head
The single permitted rerun is used, so I'm not rerunning again. The PR stays in draft until that job is green on this head, for example after #21608 lands or a maintainer reruns it. 🤖 Posted by AspireAgent (AI Agent) |
|
CI attempt 3 on head Attempt 3 passed, so every check on this head is now green: 201 success, 16 skipped, 0 failing. There are no unresolved review threads, so I'm marking this PR ready for review. 🤖 Posted by AspireAgent (AI Agent) |
…robe-timeout # Conflicts: # docs/specs/cli-config-sources.md # src/Aspire.Cli/Git/GitCommandRunner.cs
|
Merged 🤖 Posted by AspireAgent (AI Agent) |
Tests selector1 / 101 PR test projects · 0 PR jobs, from 1 changed file. Selected PR test projects (1 / 101)
Selected PR jobs (0)none How these were chosen — grouped by what changed🧪 Job reasonsnone Selection computed for commit |
There was a problem hiding this comment.
🟡 Changes recommended
The new tests do not establish the claimed caller-only timeout behavior because production still enforces a documented 30-second limit, so the implementation or description needs alignment.
1 open issue
Review effort: Balanced

Description
This PR only adds tests. The fix is in #21686, which is already on
main. With that fix, the unattended OpenSSH-Vprobe inGitCommandRunner.VerifyOpenSshAsyncwaits up to 30s instead of 5s and still respects the caller's cancellation token. This PR adds end-to-end regression tests for that behavior and does not change production code or the spec.Background
GitCommandRunnerTests.ConfigureUnattendedSsh_VerifiesOpenSshAndAppliesBatchModeAfterUrlRewritesfailed on Windows Cli jobs with "Unattended Git requires a verified OpenSSH executable…" (job 124715227362). The TRX showed that the first cold launch ofssh.exewent past the old private 5s probe timeout. A working OpenSSH client was then reported as unsupported.Tests added
tests/Aspire.Cli.Tests/Git/GitCommandRunnerTests.Authentication.csgets two Unix tests that driveConfigureUnattendedSshAsyncthrough real Git with a fakesshscript:ConfigureUnattendedSsh_SlowOpenSshVersionProbeIsAccepted:-Vprints anOpenSSH_banner after 6s, which is longer than the old 5s cap. The test asserts that the client is accepted and getsBatchMode=yes. Against the old 5s cap it failed in about 5.0s with the sameGitCommandExceptionseen in CI.ConfigureUnattendedSsh_CallerCancellationStopsHungOpenSshVersionProbe: the probe never exits. Cancelling the caller's token after the probe starts throwsOperationCanceledException, not the unsupported-SSH diagnostic.These tests complement the unit tests #21686 added for
VerifyOpenSshAsync. They exercise the full path from executable resolution to probe toGIT_SSH_COMMANDrewrite.Contributes to #21600
Confidence
GitCommandRunnerTestsclass pass locally on Linux on the merged head. CI "Final Results" is green on this head.Aspire.Cli.Testsbuilds cleanly with 0 warnings and 0 errors, and CI build jobs passed.aspire template source listrun with a slow-Vwas done before this branch was merged with Allow slow OpenSSH startup during unattended Git verification #21686 and has not been repeated on this head.How we stop this recurring: These tests fail if the OpenSSH probe timeout is shortened below a realistic cold start again, or if probe cancellation is reported as unsupported SSH.
Checklist
🤖 Posted by AspireAgent (AI Agent)