From abd3f6a4fbb6fa1e6e0c9f04c9f00cb92f78f59f Mon Sep 17 00:00:00 2001 From: Mrityunjay Raj Date: Sat, 20 Jun 2026 22:15:53 +0530 Subject: [PATCH] testsuite: corrupt archive metadata mid-object to fix flaky windows check test The last byte can land on store-level framing instead of the authenticated payload, making test_manifest_rebuild_corrupted_chunk fail intermittently on Windows. --- src/borg/testsuite/archiver/check_cmd_test.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/borg/testsuite/archiver/check_cmd_test.py b/src/borg/testsuite/archiver/check_cmd_test.py index c181c0d71d..e3fa7d3dfb 100644 --- a/src/borg/testsuite/archiver/check_cmd_test.py +++ b/src/borg/testsuite/archiver/check_cmd_test.py @@ -304,7 +304,9 @@ def test_manifest_rebuild_corrupted_chunk(archivers, request): corrupted_manifest = corrupt(manifest, 250) repository.put_manifest(corrupted_manifest) chunk = repository.get(archive.id) - corrupted_chunk = corrupt(chunk, -1) + # corrupt a byte in the middle of the object: the last byte can land on store-level + # framing rather than the authenticated payload, which made the repair flaky on Windows. + corrupted_chunk = corrupt(chunk, len(chunk) // 2) repository.put(archive.id, corrupted_chunk) cmd(archiver, "check", exit_code=1) output = cmd(archiver, "check", "-v", "--repair", exit_code=0)