Repository navigation
[release/17.0] Fix flaky ComputeRunArgumentsPopulatesRunPropertiesForSdkProject (MSBuild server fallback notice on stderr) - #22038
Closed
Mitch Denny (mitchdenny) wants to merge 1 commit into
Conversation
…uild server fallback notice on stderr) (#21955) ## Description **What failed.** `DotNetCliRunnerTests.ComputeRunArgumentsPopulatesRunPropertiesForSdkProject` failed on Windows after #21502 merged. One example is [run 42237500020](https://github.com/microsoft/aspire/actions/runs/42237500020), job `Cli (windows-latest)`, from a PR branch that already contains #21502. The process exited 0 and every property was correct, but stderr contained: `MSBuild server unavailable: could not connect to the server within the timeout window; the server may have failed to start. Falling back to an in-process build.` **Why.** The test spawns a raw `dotnet msbuild -restore -getProperty:...` and asserts that stderr is empty. With SDK 11, `dotnet msbuild` uses MSBuild server by default. A newly launched server gets 5 s to accept the client connection (`NewServerConnectionTimeoutMilliseconds` in [MSBuildClient.cs](https://github.com/dotnet/msbuild/blob/main/src/Build/BackEnd/Client/MSBuildClient.cs)). On loaded runners it misses that window, so MSBuild builds in-process and [writes this notice to stderr](https://github.com/dotnet/msbuild/blob/main/src/MSBuild/MSBuildClientApp.cs). **Fix.** Set `DOTNET_CLI_USE_MSBUILD_SERVER=0` on the test's child process, as `TemplateManifestTestEnvironment` and `TemplateRestorePlanTests` already do for the same message. The empty-stderr assertion is unchanged, so real warnings from the project still fail the test. This is a test-only change; the product probe path parses stdout and ignores this notice. Fixes #21954 ### Confidence The repro uses the real test and induces a genuine slow server start. A watcher pauses each newly launched `/nodemode:8` MSBuild server for 7 s and then resumes it (Linux, SDK 11.0.100-rc.2.26504.105, the repo-local SDK). | | Real xUnit test | Raw `dotnet msbuild` command | |---|---|---| | Before (main) | **10/10 fail**, same message, same line (`DotNetCliRunnerTests.cs:2754`) as CI | 10/10 fail | | After (this PR) | **10/10 pass** | 10/10 pass | All 93 tests in `DotNetCliRunnerTests` pass with the change, without the harness. Main uncertainty: only one post-fix CI hit could be located and confirmed with this signature. The tracker's second post-fix hit (11-07 01:06Z) could not be matched to a run, and its log may have expired. **How we stop this recurring:** tests that spawn `dotnet msbuild` and assert on its output must opt out of MSBuild server (`DOTNET_CLI_USE_MSBUILD_SERVER=0`). SDK 11 now reports server fallback on stderr. ## Failure stats (14d, attempt 1) - **Test/signature:** `Aspire.Cli.Tests.DotNet.DotNetCliRunnerTests.ComputeRunArgumentsPopulatesRunPropertiesForSdkProject`. The post-fix signature is `Assert.True(string.IsNullOrWhiteSpace(stderr))` failing on `MSBuild server unavailable: ...`. Earlier hits were the `NU1900` audit warning fixed by #21502. - **Failures/runs:** 8/1175 (≈0.68%) per tracker #21600: 3 main, 5 PR. No PR-caused failures were identified to exclude. 2 of the PR hits came after #21502, and the one I located is on a branch 0 commits behind the fix, so it is genuine. - **Rerun-pass count:** not available from the tracker data. The located PR run was rerun (attempt 4). - **Last hit:** 2026-11-07 01:06Z per tracker (run not located). Last confirmed: 2026-11-06 14:57Z, [run 42237500020](https://github.com/microsoft/aspire/actions/runs/42237500020). - **Still hitting main?** No main hit since #21502 merged (2026-11-04 23:54Z). Both post-fix hits were on PR branches. - **Local:** before 10/10 fail, after 10/10 pass (see Confidence). - **This PR's CI:** green on e0e40b6 ([CI run 42575543144](https://github.com/microsoft/aspire/actions/runs/42575543144)), including `Cli (windows-latest)`, `Cli (ubuntu-latest)` and `Cli (macos-latest)`. - **Verdict: STRONG.** The CI signature is reproduced exactly and deterministically, and the fix removes the mechanism that produces it. The sample of post-fix hits is small. ## 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 (test-only 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 <95136+davidfowl@users.noreply.github.com> Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> (cherry picked from commit bd8d7d0)
14 tasks
This comment has been minimized.
This comment has been minimized.
Mitch Denny (mitchdenny)
force-pushed
the
mitchdenny-backport-17-0-40-pr21955
branch
from
November 10, 2026 04:23
b666a35 to
7aef2b0
Compare
Mitch Denny (mitchdenny)
force-pushed
the
mitchdenny-backport-17-0-40-pr21955
branch
from
November 10, 2026 04:25
7aef2b0 to
b666a35
Compare
Contributor
|
🚀 Dogfood this PR with:
curl -fsSL https://raw.githubusercontent.com/microsoft/aspire/main/eng/scripts/get-aspire-cli-pr.sh | bash -s -- 22038Or
iex "& { $(irm https://raw.githubusercontent.com/microsoft/aspire/main/eng/scripts/get-aspire-cli-pr.ps1) } 22038" |
Mitch Denny (mitchdenny)
marked this pull request as ready for review
November 10, 2026 05:10
Member
Author
|
Approved for inclusion in release/17.0. Do not merge yet. |
Mitch Denny (mitchdenny)
requested review from
James Newton-King (JamesNK),
Adam Ratzman (adamint),
David Negstad (danegsta),
David Fowler (davidfowl),
Eric Erhardt (eerhardt),
Ella Hathaway (ellahathaway),
Karol Zadora-Przylecki (karolz-ms),
Ankit Jain (radical) and
Sébastien Ros (sebastienros)
as code owners
November 10, 2026 06:06
Mitch Denny (mitchdenny)
force-pushed
the
mitchdenny-backport-17-0-40-pr21955
branch
from
November 10, 2026 06:07
b666a35 to
6b335d5
Compare
This comment has been minimized.
This comment has been minimized.
Mitch Denny (mitchdenny)
force-pushed
the
mitchdenny-backport-17-0-40-pr21955
branch
from
November 10, 2026 06:29
6b335d5 to
b666a35
Compare
Mitch Denny (mitchdenny)
force-pushed
the
mitchdenny-backport-17-0-40-pr21955
branch
from
November 10, 2026 07:50
b666a35 to
6b335d5
Compare
Mitch Denny (mitchdenny)
force-pushed
the
mitchdenny-backport-17-0-40-pr21955
branch
from
November 10, 2026 08:39
6b335d5 to
b666a35
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Backport of #21955 to
release/17.0(cherry-picked from bd8d7d0 with no modifications).Layer 40 of 55 in the release/17.0 backport stack; stacked on #22037.
Backport recommendation: No — Test flake.
Validation: Stable patch IDs match (
ae81520aa68a427c45d52ee6cd7d96ebfd3a5d07). Builds/tests not run for this unchanged cherry-pick.Backport of #21955
Checklist
<remarks />and<code />elements on your triple slash comments?