git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH 2/3] t7703: demonstrate object corruption with pack.packSizeLimit

From
Taylor Blau <me@ttaylorr.com>
Date
May 20, 2022, 23:22 UTC
Message-ID
<YogimAfbnkxCG8IP@nand.local>
In-Reply-To
<a060d672-df82-95a3-072a-7ab7b0566556@github.com>
On Fri, May 20, 2022 at 12:42:58PM -0700, Victoria Dye wrote:
Show 19 quoted lines
> > @@ -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

Previous: Victoria DyeNext: Junio C Hamano
Message 5 of 10 in “repack: handle --keep-pack, --max-pack-size for geometric repacks”
  1. 0/3 repack: handle --keep-pack, --max-pack-size for geometric repacksTaylor Blau, May 20, 2022
  2. 1/3 repack: respect --keep-pack with geometric repackTaylor Blau, May 20, 2022
  3. 2/3 t7703: demonstrate object corruption with pack.packSizeLimitTaylor Blau, May 20, 2022
  4. Victoria DyeMay 20, 2022
  5. Taylor BlauMay 20, 2022
  6. Junio C HamanoMay 20, 2022
  7. 3/3 builtin/repack.c: ensure that `names` is sortedTaylor Blau, May 20, 2022
  8. Victoria DyeMay 20, 2022
  9. Derrick StoleeMay 20, 2022
  10. Junio C HamanoMay 20, 2022

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.