Re: [PATCH 2/3] t7703: demonstrate object corruption with pack.packSizeLimit
From: Taylor Blau <hidden>
Date: 2022-05-20 23:22:09
On Fri, May 20, 2022 at 12:42:58PM -0700, Victoria Dye wrote:
quoted
@@ -230,4 +231,50 @@ test_expect_success '--geometric chooses largest MIDX preferred pack' ' ) ' +test_expect_failure '--geometric with pack.packSizeLimit' ' + git init pack-rewrite && + test_when_finished "rm -fr pack-rewrite" && + ( + cd pack-rewrite && + + test-tool genrandom foo 1048576 >foo && + test-tool genrandom bar 1048576 >bar && +I was a bit worried about this test being flaky in the future (relying on particular pseudorandomly-generated file contents and the subsequent ordering of hashes on the packs). But, since neither 'genrandom' nor the pack hash generation seem likely to change (and I can't come up with an alternative to this approach anyway), the test looks good as-is.
Note that the "random" contents aren't so random (though I suspect you're talking about _how_ genrandom interprets the seed changing), and that we're really only depending on genrandom here to create a large amount of data. We are relying on the pack hashes appearing in a certain order, so in that sense this test could "break" even if pack-objects reported the packs it wrote in a different order. But I agree in the sense that I also cannot come up with a less brittle approach for writing this test ;). Thanks, Taylor