fix shutdown tests#129853
Conversation
|
Tagging subscribers to this area: @dotnet/area-extensions-hosting |
There was a problem hiding this comment.
Pull request overview
This PR updates the Microsoft.Extensions.Hosting functional-test deployment infrastructure to make shutdown-related tests more reliable on constrained/Helix environments by hardening process launch and shutdown handling.
Changes:
- Add a retry loop when launching the self-hosted test process, and surface early-exit failures more consistently.
- Resolve the
dotnetmuxer path relative to the currently running shared framework (with PATH fallback) for Helix environments that don’t provide a globaldotnet. - Avoid
Process.HasExitedthrowing during shutdown/cleanup when theProcessobject was never successfully started.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| src/libraries/Microsoft.Extensions.Hosting/tests/FunctionalTests/IntegrationTesting/src/Deployers/SelfHostDeployer.cs | Adds start retry logic and reorders startup flow to reduce flaky failures from transient process-launch issues. |
| src/libraries/Microsoft.Extensions.Hosting/tests/FunctionalTests/IntegrationTesting/src/Deployers/ApplicationDeployer.cs | Improves dotnet muxer resolution for Helix and hardens shutdown checks against unstarted Process instances. |
| var started = new TaskCompletionSource<object>(); | ||
| var hostExitTokenSource = new CancellationTokenSource(); | ||
|
|
| if (IsRunning(hostProcess)) | ||
| { | ||
| Logger.LogWarning("Unable to terminate the host process with process Id '{processId}", hostProcess.Id); | ||
| } |
| } | ||
| } | ||
|
|
||
| // Launching the host process can fail transiently on constrained CI/Helix machines (for example a |
There was a problem hiding this comment.
Is this really the case?
RemoteExecutor is launching a ton of process in CI/Helix machines. It does not have a retry loop like this and we do not see a problems with that.
There was a problem hiding this comment.
Hi, I'm trying to find out, the PR was generated by Copilot, please take the comments as WIP.
Fixes #129832
Summary
This change makes the functional test deployer more robust in Helix environments where dotnet is not on PATH and where process start can fail transiently.
Testing
Note
This PR description was generated with AI assistance.