tests: corrupt chunks at store level in check tests#9826
Merged
ThomasWaldmann merged 1 commit intoJun 29, 2026
Merged
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #9826 +/- ##
==========================================
- Coverage 85.23% 85.19% -0.04%
==========================================
Files 92 92
Lines 15297 15303 +6
Branches 2299 2300 +1
==========================================
- Hits 13038 13037 -1
- Misses 1570 1578 +8
+ Partials 689 688 -1 ☔ View full report in Codecov by Harness. |
732960c to
8bd1bfd
Compare
test_manifest_rebuild_corrupted_chunk now corrupts the pack at the store level and is skipped (TODO borgbackup#8572) until repair rewrites store-corrupted packs.
8bd1bfd to
3b3a647
Compare
ThomasWaldmann
requested changes
Jun 29, 2026
ThomasWaldmann
left a comment
Member
There was a problem hiding this comment.
Looks good, the PR comment needs to be updated.
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.
These check tests faked chunk corruption with
get(), a byte flip, thenput(). Theput()reframes the object through PackWriter into a fresh valid pack, so the store-level sha256 check never trips, and the flipped byte lands at a layout-dependent offset. That was flaky on Windows.test_verify_data,test_corrupted_file_chunkandtest_manifest_rebuild_corrupted_chunknow corrupt the chunk in the on-disk pack viacorrupt_chunk_on_disk, which breaks both the store-level sha256 name and the crypto MAC.The manifest-corruption tests previously overwrote a byte with a fixed value. That is a no-op whenever the byte already held that value, which for encrypted data happens ~1/256 of the time and caused intermittent failures. They now use a
corrupt()helper that flips all bits of one byte instead.test_manifest_rebuild_corrupted_chunkandtest_empty_repositoryare skipped with a TODO: repair does not yet rewrite store-corrupted packs (#8572).test_spoofed_archiveandtest_extra_chunksget arepository.flush()so the put is durable before the following check.