Re-enable Microsoft.Extensions.Hosting shutdown functional coverage in CI and harden Helix/NET481 compatibility#128252
Re-enable Microsoft.Extensions.Hosting shutdown functional coverage in CI and harden Helix/NET481 compatibility#128252Copilot wants to merge 19 commits into
Conversation
Agent-Logs-Url: https://github.com/dotnet/runtime/sessions/f2762648-8aaf-44cd-a0bb-269b2a6b371d Co-authored-by: rosebyte <14963300+rosebyte@users.noreply.github.com>
|
@copilot , the shutdown tests are failing with this error on helix machines: Comments Error message Stack trace |
Agent-Logs-Url: https://github.com/dotnet/runtime/sessions/e8bb9c1b-1794-4ebc-a563-bec6823fec1c Co-authored-by: rosebyte <14963300+rosebyte@users.noreply.github.com>
... Fixed in b9cd702. I removed the source-tree lookup and switched the shutdown tests to run TestApp from the deployed test output ( |
|
@copilot , this time it failed with this error: Test Failures (700 tests failed) ❌ Microsoft.AspNetCore.Hosting.FunctionalTests.ShutdownTests.ShutdownTestRun [Console] [Details] [Artifacts] [0.70% failure rate] |
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
| @@ -3,8 +3,6 @@ | |||
| <PropertyGroup> | |||
| <TargetFrameworks>$(NetCoreAppCurrent);$(NetFrameworkCurrent)</TargetFrameworks> | |||
| <EnableDefaultItems>true</EnableDefaultItems> | |||
…fter Kill() Co-authored-by: rosebyte <14963300+rosebyte@users.noreply.github.com>
|
@copilot , you only addressed one of my comments, resolve all of them. |
… 180s for stress environments Co-authored-by: rosebyte <14963300+rosebyte@users.noreply.github.com>
Fixed in f9172b4. I've addressed both remaining issues:
|
Description
This PR re-enables
Microsoft.Extensions.Hostingshutdown functional coverage in CI and hardens the tests for Helix/minimal Linux environments where source layout or common external tools may be unavailable, while also ensuring the updated shutdown signal path compiles fornet481test legs.Changes Made
ShutdownTestsdeployment to runMicrosoft.Extensions.Hosting.TestAppfrom deployed test output (AppContext.BaseDirectory) instead of source-project lookup.IgnoreForCI) and the assembly-levelActiveIssue.pgrepand improve robustness of shutdown/termination paths in minimal environments.killfor SIGINT delivery inShutdownTestsby usinglibc kill(pid, SIGINT).net481compatibility inShutdownTestsby usingMarshal.GetLastWin32Error()(instead ofMarshal.GetLastPInvokeError()) for the P/Invoke error path, resolving Windows x86Libraries_NET481build failures.ExistingOutputApplicationPublisherreturned aPublishedApplicationrooted atAppContext.BaseDirectory, whoseDispose()would recursively delete the test output directory:PublishedApplication.Dispose()virtualin the integration testing harness.BorrowedPublishedApplicationnested class insideExistingOutputApplicationPublisherthat overridesDispose()as a no-op, since the path is borrowed from test output and must not be deleted.PreservePublishedApplicationForDebugging = truefromDeploymentParameters; the structural fix makes this flag unnecessary.WaitForExitOrKillnow waits up to 5 seconds after callingKill()before accessingExitCode, preventingInvalidOperationExceptionrace conditions.KillProcessUnixuseskill -TERMfor graceful termination (SIGTERM) instead ofProcess.Kill()(SIGKILL), allowing processes to perform cleanup before exiting.Validation
./build.sh clr+libs -rc releasedotnet build /t:test ./tests/FunctionalTests/Microsoft.Extensions.Hosting.Functional.Tests.csprojnet481build validation passed:dotnet build ./tests/FunctionalTests/Microsoft.Extensions.Hosting.Functional.Tests.csproj -p:TargetFramework=net481 -c Releasecodeql_checkerexecuted for this change.