Skip to content

Do not let CleanRoot failures break startup - #1117

Merged
SimonCropp merged 3 commits into
mainfrom
clean-root-tolerate-failures
Oct 9, 2026
Merged

SimonCropp merged 3 commits into
mainfrom
clean-root-tolerate-failures

Conversation

@SimonCropp

Copy link
Copy Markdown
Owner

DirectoryCleaner.CleanRoot runs from the DirectoryFinder static constructor and had no protection around the per-directory clean. Any exception there surfaced as a TypeInitializationException and failed every test in the run.

This can happen when two test processes start at the same time and both try to clean the same stale directory: one removes the directory while the other is still deleting files, and File.Delete throws DirectoryNotFoundException.

Each per-directory clean is now wrapped in a try/catch that logs when verbose and moves on, matching what CleanInstanceRoot already does.

@SimonCropp SimonCropp added this to the 27.2.4 milestone Oct 9, 2026
@SimonCropp
SimonCropp merged commit 3237ff3 into main Oct 9, 2026
4 checks passed
@SimonCropp
SimonCropp deleted the clean-root-tolerate-failures branch October 9, 2026 10:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant