Fix flaky E2E test: retry MSBuild evaluation on empty output#14868
Merged
davidfowl merged 2 commits intorelease/13.2from Mar 3, 2026
Merged
Fix flaky E2E test: retry MSBuild evaluation on empty output#14868davidfowl merged 2 commits intorelease/13.2from
davidfowl merged 2 commits intorelease/13.2from
Conversation
Whitespace change to trigger CI pipeline and E2E test execution for reproducing the flaky DetachFormatJsonProducesValidJson test. Fixes #14819 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Contributor
|
🚀 Dogfood this PR with:
curl -fsSL https://raw.githubusercontent.com/dotnet/aspire/main/eng/scripts/get-aspire-cli-pr.sh | bash -s -- 14868Or
iex "& { $(irm https://raw.githubusercontent.com/dotnet/aspire/main/eng/scripts/get-aspire-cli-pr.ps1) } 14868" |
Contributor
There was a problem hiding this comment.
Pull request overview
This PR is intended to retrigger CI to help reproduce and investigate the flaky DetachFormatJsonProducesValidJson end-to-end test failure (stdout “bleed” into JSON output) described in #14819.
Changes:
- Adds a trailing newline at the end of
MultipleAppHostTests.cs(no functional/test logic changes).
When dotnet msbuild -getProperty/-getItem returns exit code 0 but produces no stdout output (likely due to MSBuild server contention when another AppHost process is running), JsonDocument.Parse would throw 'The input does not contain any JSON tokens', crashing the aspire run --detach --format json command. This fix adds retry logic (up to 3 attempts with increasing delay) for this specific case, making the project discovery more resilient to concurrent MSBuild operations. Fixes #14819 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Contributor
🎬 CLI E2E Test RecordingsThe following terminal recordings are available for commit
📹 Recordings uploaded automatically from CI run #22607222648 |
JamesNK
approved these changes
Mar 3, 2026
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
Fixes the flaky
DetachFormatJsonProducesValidJsonE2E test inMultipleAppHostTests.Root Cause
When running
aspire run --detach --format jsonwhile a previous detached AppHost is still running, the CLI callsdotnet msbuild -getProperty:... -getItem:...to evaluate project properties during AppHost discovery. Intermittently, this MSBuild evaluation returns exit code 0 but produces empty stdout output — likely due to MSBuild server contention with the already-running AppHost's build processes.The empty output then caused
JsonDocument.Parse("")to throw:This was confirmed by downloading and analyzing the asciinema recording from the original failing CI run (artifact from PR #14811 run 22528127115).
Fix
Added retry logic (up to 3 attempts with increasing delay) in
DotNetCliRunner.GetProjectItemsAndPropertiesAsyncspecifically for the case where MSBuild returns success but produces no output. This makes project discovery resilient to transient MSBuild server contention without changing the behavior for normal success or error cases.Fixes #14819
Checklist