]> git.ipfire.org Git - thirdparty/git.git/commitdiff
t5500: count objects through stderr, not trace
authorJonathan Tan <jonathantanmy@google.com>
Wed, 6 May 2020 22:07:40 +0000 (15:07 -0700)
committerJunio C Hamano <gitster@pobox.com>
Wed, 6 May 2020 22:38:06 +0000 (15:38 -0700)
In two tests introduced by 4fa3f00abb ("fetch-pack: in protocol v2,
in_vain only after ACK", 2020-04-28) and 2f0a093dd6 ("fetch-pack: in
protocol v2, reset in_vain upon ACK", 2020-04-28), the count of objects
downloaded is checked by grepping for a specific message in the packet
trace. However, this is flaky as that specific message may be delivered
over 2 or more packet lines.

Instead, grep over stderr, just like the "fetch creating new shallow
root" test in the same file.

Signed-off-by: Jonathan Tan <jonathantanmy@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
t/t5500-fetch-pack.sh

index fd39aad93ff989e16a531bfcb6719a9d6bc73032..041b2d3d6e60185e755054265e611c824325fdf0 100755 (executable)
@@ -386,7 +386,7 @@ test_expect_success 'clone shallow with packed refs' '
 '
 
 test_expect_success 'in_vain not triggered before first ACK' '
-       rm -rf myserver myclient trace &&
+       rm -rf myserver myclient &&
        git init myserver &&
        test_commit -C myserver foo &&
        git clone "file://$(pwd)/myserver" myclient &&
@@ -399,12 +399,12 @@ test_expect_success 'in_vain not triggered before first ACK' '
        # The new commit that the client wants to fetch.
        test_commit -C myserver bar &&
 
-       GIT_TRACE_PACKET="$(pwd)/trace" git -C myclient fetch --progress origin &&
-       test_i18ngrep "Total 3 " trace
+       git -C myclient fetch --progress origin 2>log &&
+       test_i18ngrep "remote: Total 3 " log
 '
 
 test_expect_success 'in_vain resetted upon ACK' '
-       rm -rf myserver myclient trace &&
+       rm -rf myserver myclient &&
        git init myserver &&
 
        # Linked list of commits on master. The first is common; the rest are
@@ -429,8 +429,8 @@ test_expect_success 'in_vain resetted upon ACK' '
        # first. The 256th commit is common between the client and the server,
        # and should reset in_vain. This allows negotiation to continue until
        # the client reports that first_anotherbranch_commit is common.
-       GIT_TRACE_PACKET="$(pwd)/trace" git -C myclient fetch --progress origin master &&
-       test_i18ngrep "Total 3 " trace
+       git -C myclient fetch --progress origin master 2>log &&
+       test_i18ngrep "Total 3 " log
 '
 
 test_expect_success 'fetch in shallow repo unreachable shallow objects' '