Re: [PATCH v2 3/4] t5300: move --window clamp test next to unclamped

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, Nov 13, 2024 at 02:35:00AM -0500, Jeff King wrote:

> On Fri, Nov 01, 2024 at 01:11:47PM -0700, Jonathan Tan wrote:
> 
> > A subsequent commit will change the behavior of "git index-pack
> > --promisor", which is exercised in "build pack index for an existing
> > pack", causing the unclamped and clamped versions of the --window
> > test to exhibit different behavior. Move the clamp test closer to the
> > unclamped test that it references.
> 
> Hmm. The change in patch 4 broke another similar --window test I had in
> a topic in flight. I can probably move it to match what you've done
> here, but I feel like this may be papering over a bigger issue.
> 
> The reason these window tests are broken is that the earlier "build pack
> index for an existing pack" is now finding and storing deltas in a new
> pack when it does this:
> 
>   git index-pack --promisor=message test-3.pack &&

BTW, an alternate fix instead of moving the test is below. But maybe not
worth revisiting since it's already in next.

-- >8 --
Subject: [PATCH] t5300: use --no-reuse-delta for --window test

In the test added for 953aa54e1a (pack-objects: clamp negative window
size to 0, 2021-05-01), we expect that dropping the --window parameter
will mean the resulting pack does not have any deltas. But this
expectation would not hold if there are deltas from an on-disk pack that
are reused.

This makes the test fragile with respect to the existing repository
state. It works reliably now, but changes to earlier tests could produce
packs that violate the assumption.

We can make the test more reliable by passing --no-reuse-delta, meaning
we will only output deltas we find in the current run (using --window).

Signed-off-by: Jeff King <peff@xxxxxxxx>
---
 t/t5300-pack-object.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/t/t5300-pack-object.sh b/t/t5300-pack-object.sh
index 3b9dae331a..392d6a4d41 100755
--- a/t/t5300-pack-object.sh
+++ b/t/t5300-pack-object.sh
@@ -631,7 +631,7 @@ test_expect_success 'prefetch objects' '
 '
 
 test_expect_success 'negative window clamps to 0' '
-	git pack-objects --progress --window=-1 neg-window <obj-list 2>stderr &&
+	git pack-objects --progress --no-reuse-delta --window=-1 neg-window <obj-list 2>stderr &&
 	check_deltas stderr = 0
 '
 
-- 
2.47.0.527.gfb211c7f3b





[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux