Conversation
…st can't clean up
Code Review SummaryStatus: No Issues Found | Recommendation: Merge Overview
Changes ReviewedThis PR improves test isolation by:
Files Reviewed (1 file)
NotesThe |
There was a problem hiding this comment.
Pull request overview
This PR refactors TestBase scratch-directory handling to improve test isolation by moving from shared, solution-relative scratch folders to per-test unique temp directories under the system temp path, and centralizes cleanup/reset logic.
Changes:
- Replace static shared
Scratch/Scratch2directories with per-test directories underPath.GetTempPath(). - Add helper methods to reset scratch directories and to delete the entire per-test temp root during teardown.
- Improve teardown debuggability by throwing a clearer exception when temp cleanup fails.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This pull request refactors the way temporary scratch directories are handled in the
TestBaseclass for the test suite. Instead of using static, shared directories for scratch files, each test now uses its own unique temporary directory, which improves test isolation and cleanup reliability. The code for creating, resetting, and deleting these directories has also been made more robust.Improvements to test directory management:
Robustness and cleanup enhancements:
DisposeAsyncmethod now calls a newDeleteScratchDirectoryhelper, which attempts to delete the test's temp directory and throws a clear exception if cleanup fails.CleanScratchmethod now uses a newResetScratchDirectoryhelper to safely reset both scratch directories for the test.