[CI Flakiness] Fix MSB4216 task host failures on macOS and dotnet-watch test hangs#53423
Open
mmitche wants to merge 2 commits intodotnet:mainfrom
Open
[CI Flakiness] Fix MSB4216 task host failures on macOS and dotnet-watch test hangs#53423mmitche wants to merge 2 commits intodotnet:mainfrom
mmitche wants to merge 2 commits intodotnet:mainfrom
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Reduces CI flakiness in Helix by improving MSBuild task host resolution (MSB4216 on macOS) and preventing dotnet-watch tests from hanging indefinitely when processes fail to terminate.
Changes:
- Export
DOTNET_HOST_PATHin Helix test runner scripts so MSBuild task hosts can reliably locate the dotnet host. - Bound DCP/Aspire watch operation timeouts in
WatchableAppto avoid multi-hour hangs. - Improve process teardown in test utilities by closing stdin before killing and adding a bounded wait for process exit.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| test/Microsoft.DotNet.HotReload.Test.Utilities/WatchableApp.cs | Replaces “effectively infinite” DCP/Aspire timeouts with bounded (300s) values to avoid Helix-duration hangs. |
| test/Microsoft.DotNet.HotReload.Test.Utilities/AwaitableProcess.cs | Improves disposal reliability by closing stdin before kill and adding a 30s exit wait timeout. |
| build/RunTestsOnHelix.sh | Sets DOTNET_HOST_PATH for Helix runs (notably fixes MSB4216 on macOS task hosts). |
| build/RunTestsOnHelix.cmd | Same as above for Windows Helix runs. |
Comments suppressed due to low confidence (1)
test/Microsoft.DotNet.HotReload.Test.Utilities/AwaitableProcess.cs:263
- If the 30s timeout elapses, DisposeAsync continues without ensuring
_processExitAwaiterhas completed. In that caseWaitForProcessExitAsync()may later try to call_outputCompletionSource.Cancel()after_outputCompletionSource.Dispose()runs here, which can throwObjectDisposedExceptionand introduce new flakiness. Consider either (a) not disposing_outputCompletionSourceuntil_processExitAwaiterhas completed, or (b) makingWaitForProcessExitAsync()tolerate_outputCompletionSourcebeing disposed (e.g., catchObjectDisposedExceptionaroundCancel()).
Process.Dispose();
_outputCompletionSource.Dispose();
}
You can also share your feedback on Copilot code review. Take the survey.
810cbfc to
666a7d6
Compare
666a7d6 to
b79f8b6
Compare
004d47a to
329b2a7
Compare
Root causes fixed: 1. MSB4216 Task Host Failures (macOS): Set DOTNET_HOST_PATH in Helix scripts 2. AspireServiceFactory Semaphore Deadlock: Release semaphore when count==0 at disposal 3. AwaitableProcess Timeout: Cap per-operation timeout at 5min, close stdin before kill 4. Razor Tool Test Thread Starvation: Use dedicated thread for blocking dispatcher Validation: 6 consecutive green builds (18/18 jobs), then 1 infrastructure flake (Roslyn NuGet restore timeout - unrelated to changes) Baseline: 48/100 builds failed (48% failure rate)
329b2a7 to
5a8c007
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.
Fix two major CI flakiness root causes:
Baseline: 48/100 builds failed (48% failure rate)