Remove each test's tmp_path after it finishes - #246
Open
MaxGhenis wants to merge 1 commit into
Open
Conversation
The merged-bundle test builds real source suites under tmp_path, about 14 GB per run, and the CLI bundle tests add a few hundred MB each. pytest keeps the three newest base temp directories and only prunes older ones when no other session holds a lock, so with many pytest sessions running at once the outputs pile up: 69 base directories totalling 190 GB were sitting in the macOS temp folder today. Override tmp_path in tests/conftest.py to delete the per-test directory once the test completes, keeping the base temp directory bounded no matter how many sessions are active. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
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.
What
Adds
tests/conftest.pywith atmp_pathoverride that deletes each test's temp directory after the test finishes.Why
test_build_bundle_writes_merged_consumer_contractbuilds the real source-package suites undertmp_path, about 14 GB per run, and the CLI bundle tests add a few hundred MB each. pytest keeps the three newestpytest-Nbase directories and only prunes older ones when no other pytest session holds a lock on them. With many agent sessions running the suite concurrently, nothing ever gets pruned: this morning the macOS temp folder held 69 base directories totalling 190 GB, almost all from this one test.Removing the per-test directory at teardown keeps the base temp directory bounded no matter how many sessions are active.
Verification
Full suite on this branch with
--basetemppointed at a fresh directory:The base temp directory held 12 KB afterwards.
🤖 Generated with Claude Code