@matheusbsbs / matheus-bagliano / commits / 2b695ecd74
Fork 0

t5500: count objects through stderr, not trace

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>

Jonathan Tan committed May 6, 2020 at 15:07 UTC 2b695ecd74d174e23ed09c1c044f1313de538d15
1 file changed +6 -6
t/t5500-fetch-pack.sh
+6 -6
@@ -386,7 +386,7 @@ test_expect_success 'clone shallow with packed refs' '
386 '
387
388 test_expect_success 'in_vain not triggered before first ACK' '
389 - rm -rf myserver myclient trace &&
389 + rm -rf myserver myclient &&
390 git init myserver &&
391 test_commit -C myserver foo &&
392 git clone "file://$(pwd)/myserver" myclient &&
@@ -399,12 +399,12 @@ test_expect_success 'in_vain not triggered before first ACK' '
399 # The new commit that the client wants to fetch.
400 test_commit -C myserver bar &&
401
402 - GIT_TRACE_PACKET="$(pwd)/trace" git -C myclient fetch --progress origin &&
403 - test_i18ngrep "Total 3 " trace
402 + git -C myclient fetch --progress origin 2>log &&
403 + test_i18ngrep "remote: Total 3 " log
404 '
405
406 test_expect_success 'in_vain resetted upon ACK' '
407 - rm -rf myserver myclient trace &&
407 + rm -rf myserver myclient &&
408 git init myserver &&
409
410 # 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' '
429 # first. The 256th commit is common between the client and the server,
430 # and should reset in_vain. This allows negotiation to continue until
431 # the client reports that first_anotherbranch_commit is common.
432 - GIT_TRACE_PACKET="$(pwd)/trace" git -C myclient fetch --progress origin master &&
433 - test_i18ngrep "Total 3 " trace
432 + git -C myclient fetch --progress origin master 2>log &&
433 + test_i18ngrep "Total 3 " log
434 '
435
436 test_expect_success 'fetch in shallow repo unreachable shallow objects' '