Repository navigation
tests: speed up the prune tests (1.4-maint) - #10543
Merged
ThomasWaldmann merged 2 commits intoOct 24, 2026
Merged
Conversation
The prune tests backed up the whole borg package (src_dir) for every archive they create, although prune only looks at archive names and timestamps. Back up a single small file instead. The prune rules are evaluated client-side, so do not run the tests that only check them again against a remote repository. test_prune_repository and the stats tests still run against a remote repository. archiver.py on 18 workers: 40s -> 28s; the slowest prune test went from 19s to below 2s. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The FreeBSD package repository does not have python310 / py310-sqlite3 anymore, so pkg install failed and the job aborted before running any tests. The job uses Python 3.11 for the venv and tox, so 3.10 was not used anyway. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## 1.4-maint #10543 +/- ##
=============================================
+ Coverage 82.10% 82.22% +0.12%
=============================================
Files 38 38
Lines 11480 11480
Branches 1808 1808
=============================================
+ Hits 9426 9440 +14
+ Misses 1468 1457 -11
+ Partials 586 583 -3 ☔ View full report in Codecov by Harness. |
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.
Description
The prune tests in
archiver.pywere the slowest tests in the suite. They spent their time on things prune does not care about:createbacked upsrc_dir, the wholesrc/borgpackage, although prune only looks at archive names and timestamps. They now back up a single 1 KiB file.RemoteArchiverTestCaseran every prune test again throughborg serve, which costs a subprocess start per command (~75 commands intest_prune_retain_and_expire_oldest). The prune rules are evaluated client-side, so the tests that only check the rules (example,quarterly,retain_and_expire_oldest,prefix,glob) are skipped for remote.test_prune_repositoryand the stats tests still run against a remote repository.master already does both (the
backup_filesfixture andkinds="local,binary"inprune_cmd_test.py).src/borg/testsuite/archiver.py, macOS, 18 xdist workers, on a RAM disk:test_prune_retain_and_expire_oldest)test_benchmark_crud)Test-only change.
Checklist
master(or maintenance branch if only applicable there)toxor the relevant test subset)🤖 Generated with Claude Code