From: Derrick Stolee <stolee@gmail.com>
To: Jonathan Tan <jonathantanmy@google.com>, git@vger.kernel.org
Subject: Re: [PATCH] t5551: test usage of chunked encoding explicitly
Date: Wed, 5 Jun 2019 15:40:44 -0400 [thread overview]
Message-ID: <38419c39-cf69-099e-7ab1-2d4c4d9fbb74@gmail.com> (raw)
In-Reply-To: <20190605192624.129677-1-jonathantanmy@google.com>
On 6/5/2019 3:26 PM, Jonathan Tan wrote:
> When run using GIT_TEST_PROTOCOL_VERSION=2, a test in t5551 fails
> because 4 POSTs (probe, ls-refs, probe, fetch) are sent instead of 2
> (probe, fetch).
>
> One way to resolve this would be to relax the condition (from "= 2" to
> greater than 1, say), but upon further inspection, the test probably
> shouldn't be counting the number of POSTs. This test states that large
> requests are split across POSTs, but this is not correct; the main
> change is that chunked transfer encoding is used, but the request is
> still contained within one POST. (The test coincidentally works because
> Git indeed sends 2 POSTs in the case of a large request, but that is
> because, as stated above, the first POST is a probing RPC - see
> post_rpc() in remote-curl.c for more information.)
>
> Therefore, instead of counting POSTs, check that chunked transfer
> encoding is used. This also has the desirable side effect of passing
> with GIT_TEST_PROTOCOL_VERSION=2.
I'm all for testing the _right_ thing.
> -test_expect_success 'large fetch-pack requests can be split across POSTs' '
> +test_expect_success 'large fetch-pack requests can be sent using chunked encoding' '
> GIT_TRACE_CURL=true git -c http.postbuffer=65536 \
> clone --bare "$HTTPD_URL/smart/repo.git" split.git 2>err &&
> - grep "^=> Send header: POST" err >posts &&
> - test_line_count = 2 posts
> + grep "^=> Send header: Transfer-Encoding: chunked" err
> '
And this does seem to be testing what you now claim it tests.
LGTM.
-Stolee
next prev parent reply other threads:[~2019-06-05 19:40 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-06-05 19:26 [PATCH] t5551: test usage of chunked encoding explicitly Jonathan Tan
2019-06-05 19:40 ` Derrick Stolee [this message]
2019-06-05 19:41 ` Jeff King
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=38419c39-cf69-099e-7ab1-2d4c4d9fbb74@gmail.com \
--to=stolee@gmail.com \
--cc=git@vger.kernel.org \
--cc=jonathantanmy@google.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).