Repository navigation
Retry test cleanup while Windows still locks dotnet.exe - #744
Merged
mmitche merged 4 commits intoNov 4, 2026
Merged
Conversation
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Contributor
Author
|
Hi @ellahathaway and @MichaelSimons, this one is small and CI is green. It retries the test folder cleanup when Windows still has Thanks! |
Member
@akirayamamoto , thanks for your contribution. @dotnet/install-scripts-maintainers is the team to ping for approval or other questions. @ellahathaway and myself, are focusing in different areas at the moment. |
mmitche
approved these changes
Nov 4, 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.
Why
Windows CI sometimes fails a test that actually passed, during cleanup:
Seen in #659 and again on #743 (
WhenInstallingASpecificVersionOfDotnetRuntime, 7.0.0-alpha). #660 made the error visible but didn't stop it.Root cause
Each test runs
dotnet --infofrom its install folder, thenDispose()deletes that folder. Windows can keepdotnet.exelocked for a moment after the process exits (for example while antivirus scans it), so the first delete attempt can fail.Approach
TestUtils.DeleteInstallationDirectory.UnauthorizedAccessExceptionorIOException(file in use), up to 8 attempts. The wait doubles from 100 ms and is capped at 1 s, so it gives up after about 4.5 s. Then it throws the same "Failed to remove" error as before.Validation
I reproduced the failure on a Windows GitHub Actions runner in my fork with a temporary test that deletes the folder while a copied executable is still running from it:
Access to the path 'dotnet.exe' is deniederror.I left that test out of this PR, since the suite doesn't test its own helpers.
Follow-up to #659
🤖 Generated with Claude Code