Repository navigation
Fix dotnet-watch dependency output races - #55618
Merged
JeremyKuhne merged 2 commits intoAug 6, 2026
Merged
Conversation
|
Azure Pipelines: Successfully started running 1 pipeline(s). 2 pipeline(s) were filtered out due to trigger conditions. There may be pipelines that require an authorized user to comment /azp run to run. |
Contributor
There was a problem hiding this comment.
Pull request overview
This PR hardens dotnet-watch in-proc Hot Reload tests against output ordering races by waiting on a dedicated completion signal for the dependency-resolution diagnostic instead of inspecting a concurrently appended output buffer.
Changes:
- Added a
hasResolvedDependencycompletion source in both project- and package-reference update tests, set fromOnProcessOutputwhen the expected “Resolving …” diagnostic is observed. - Replaced the post-output
ProcessOutputsubstring assertion with an explicitWaitAsyncbounded by a 30-second cancellation token.
JeremyKuhne
enabled auto-merge (squash)
August 5, 2026 21:07
tmat
requested changes
Aug 5, 2026
tmat
reviewed
Aug 5, 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.
Summary
Fix timing races in the
dotnet-watchproject- and package-reference update tests.The tests wait for application output and then immediately inspect a concurrently populated process-output list for the dependency resolver diagnostic. Application stdout can be delivered before the resolver diagnostic from the other redirected stream, even though resolution completed successfully. This caused
ProjectAndSourceFileChange_AddPackageReferenceto fail intermittently on macOS arm64; the CI log showed the expected diagnostic arriving during teardown immediately after the assertion.Register completion signals for the resolver diagnostics before starting watch and await them directly using the watcher's shutdown token. Apply the same fix to the project-reference variant tracked by #53661.
Fixes #53661
Validation
dotnet-watch.Testsbuilds successfully.ProjectAndSourceFileChange_AddPackageReference: passed.ProjectUpdateInProcTestsclass: 3/3 passed after the review update.