Repository navigation
Wait for SCM deletion in Windows service tests - #138048
Merged
steveisok merged 1 commit intoNov 21, 2026
Merged
Conversation
Co-authored-by: Copilot App <[email protected]>
|
Azure Pipelines: Successfully started running 3 pipeline(s). 12 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
|
Tagging subscribers to this area: @dotnet/area-extensions-hosting |
lewing
approved these changes
Nov 21, 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.
Windows SCM can keep a stopped service queryable after
DeleteServicesucceeds and the creation handle closes. The immediate deletion assertion in the Windows service cleanup tests can therefore fail despite successful cleanup.Poll deletion in the shared
AssertServiceDeletedhelper using the existing three-minute service-test timeout, refreshing status on each check. Success still requiresERROR_SERVICE_DOES_NOT_EXIST(1060); other errors propagate immediately, and timeout failures report the service name and last status. Add a regression that retains an observer handle and closes it after confirming the deletion assertion remains pending. This changes test infrastructure only and preserves the existing disposal and remote-exception assertions.Validation
CanWaitForServiceDeletionWhenHandleClosesfailed with the old assertion on bothnet12.0-windowsandnet481, then passed with the fix.build.cmd clr+libs -rc release— passed using the VS 2022 developer environment and a temporary short worktree alias; zero warnings/errors..\dotnet.cmd build /t:Test src\libraries\Microsoft.Extensions.Hosting.WindowsServices\tests\Microsoft.Extensions.Hosting.WindowsServices.Tests.csproj /p:RuntimeConfiguration=Release— passed: 16 .NET 12 tests and 15 .NET Framework 4.8.1 tests, zero failures/skips..\dotnet.cmd build /t:Test src\libraries\Microsoft.Extensions.Hosting.WindowsServices\tests\Microsoft.Extensions.Hosting.WindowsServices.Tests.csproj /p:RuntimeConfiguration=Release /p:TestNoBuild=true --no-restore "/p:XUnitOptions=-method Microsoft.Extensions.Hosting.UseWindowsServiceTests.CanDisposeServiceWithoutStarting -method Microsoft.Extensions.Hosting.UseWindowsServiceTests.CanDeleteServiceWhenRemoteProcessFails -method Microsoft.Extensions.Hosting.UseWindowsServiceTests.CanWaitForServiceDeletionWhenHandleCloses"— 25 iterations per framework; 200 test executions passed, zero failures/skips.Validation used local Windows build 26100/x64. The original Windows 10/x86/checked-CoreCLR CI configuration was not rebuilt.
Resolves #137647
Resolves #137746
Note
This pull request was generated with GitHub Copilot.