Skip to content

Clean up test databases at exit - #537

Merged
stephencelis merged 2 commits into
mainfrom
cleanup-test-databases
Aug 26, 2026
Merged

Clean up test databases at exit#537
stephencelis merged 2 commits into
mainfrom
cleanup-test-databases

Conversation

@stephencelis

Copy link
Copy Markdown
Member

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.

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.
@stephencelis
stephencelis requested a review from mbrandonw August 26, 2026 18:53
@stephencelis
stephencelis merged commit 6dc210d into main Aug 26, 2026
5 checks passed
@stephencelis
stephencelis deleted the cleanup-test-databases branch August 26, 2026 19:33
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.
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.

2 participants