benchmark tests: extract into an empty directory, fixes #10057 regression - #10395
Merged
ThomasWaldmann merged 1 commit intoSep 19, 2026
Merged
Conversation
regression test_extract ran "borg extract" with the cwd set to the tmpdir that the repo_url fixture also uses for the repository, the keys dir and the cache dir. That directory is therefore never empty, so since extract refuses to extract into a non-empty directory (see borgbackup#10057), all 8 parametrisations failed with rc 33 (ExtractionDirNotEmpty) already on the first (and, with the pedantic defaults rounds=1/iterations=1/warmup_rounds=0, only) call. Extract into a dedicated, per-round empty subdirectory created by pedantic's setup hook, which is not timed. Using --continue instead would keep the test green, but it makes extract stat and compare the files that are already there, which is not the extract that this benchmark is supposed to measure. The per-round directory also keeps the benchmark correct if rounds or warmup_rounds are ever raised above the defaults. The other benchmark tests are not affected: they do not write into the cwd. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #10395 +/- ##
==========================================
+ Coverage 88.16% 88.23% +0.07%
==========================================
Files 103 103
Lines 18840 18876 +36
Branches 2924 2933 +9
==========================================
+ Hits 16611 16656 +45
+ Misses 1553 1544 -9
Partials 676 676 ☔ 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.
Since #10057 (commit 1b7ff2b),
borg extractrefuses to extract into a non-empty directory unless--continueis given.src/borg/testsuite/benchmark_test.pywas missed by that change, so all 8 parametrisations oftest_extractfail with rc 33 (ExtractionDirNotEmpty) on current master.The test ran extract with the cwd set to the
tmpdirthat therepo_urlfixture also uses for the repository, the keys directory and the cache directory. That directory is never empty, so the very first (and, with thebenchmark.pedanticdefaultsrounds=1,iterations=1,warmup_rounds=0, only) extract already aborts.Fix: extract into a dedicated empty subdirectory, created per round by
pedanticssetuphook, which is not timed. Passing--continuewould also make the test green, but it makes extract stat and compare the files that are already there, which is not the extract this benchmark is meant to measure. Creating the directory per round also keeps the benchmark correct ifroundsorwarmup_roundsare ever raised above the defaults.The other benchmark tests are not affected -
test_create_*,test_delete,test_list,test_infoandtest_checkdo not write into the cwd.borg benchmark crudextracts with--dry-run, which is exempt from the check.CI does not catch this: every pytest invocation in
.github/workflows/and in the tox config passes--benchmark-skip, so the benchmark tests are never run there.Test-only change, so no
docs/changes.rstentry.Before: 8 failed, 44 passed. After: 52 passed.
🤖 Generated with Claude Code