Clean up test databases at exit - #537
Merged
Merged
Conversation
While test databases are provisioned in the temporary directory, the OS doesn't necessarily actively clean them up till restart. So we've heard a report of a user with a long uptime accumulating many, many gigabytes over many hundreds of test runs. This adds a small `atexit` hook to prune temporary databases. It won't run if tests are cancelled or crashed, but those cases seem rare enough that we can let the OS do that cleanup eventually.
mbrandonw
approved these changes
Aug 26, 2026
stephencelis
added a commit
that referenced
this pull request
Aug 26, 2026
This is a partial revert of #537. Instead of doing extra work to try to detect parallel test suites, let's just make it easier for folks to purge the directory themselves if they need to.
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.
While test databases are provisioned in the temporary directory, the OS doesn't necessarily actively clean them up till restart. So we've heard a report of a user with a long uptime accumulating many, many gigabytes over many hundreds of test runs.
This adds a small
atexithook to prune temporary databases. It won't run if tests are cancelled or crashed, but those cases seem rare enough that we can let the OS do that cleanup eventually.