Repository navigation
test: delete the temporary files the tests create - #191
Open
Blackclaws wants to merge 1 commit into
Open
Blackclaws wants to merge 1 commit into
Blackclaws wants to merge 1 commit into
Conversation
A test run left 51 files in the temporary directory per target framework, 88 MB each time. Most are the fixtures TestUtils.PrepareTestFile writes with the HDF5 C library: its callers keep reading them after it returns, so it now records every path it hands out and deletes them when the test process exits. The rest are tests that create a file and never remove it - the writing link tests, the circular reference test, and the external file of the external link tests - which now delete it in a finally block like the other writing tests. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This branch has not been deployed
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.
A test run leaves 51 files, 88 MB, in the temporary directory per target framework - about 176 MB for a full
dotnet testover net8.0 and net10.0. On a machine whose/tmpis a tmpfs that adds up quickly.Nearly all of them are the fixtures
TestUtils.PrepareTestFilewrites through the HDF5 C library. Its 159 callers keep reading the file after it returns, often through objects that outlive the test method, so none of them deletes it. The helper now records every path it hands out and deletes them when the test process exits (best effort: a file still held open cannot be deleted on Windows).The rest are tests that create a file and never remove it - the writing link tests,
ThrowsForCircularObjectReference, and the external file of the two external link tests. They now delete it in afinallyblock, like the other writing tests.Verification
TMPDIRpointed at an empty directory, fulldotnet test(net8.0 and net10.0): 51 + 51 files left behind before, none after. All tests pass.🤖 Generated with Claude Code