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

Re: [PATCH] t5551: test usage of chunked encoding explicitly

From
Derrick Stolee <stolee@gmail.com>
Date
Jun 5, 2019, 19:40 UTC
Message-ID
<38419c39-cf69-099e-7ab1-2d4c4d9fbb74@gmail.com>
In-Reply-To
<20190605192624.129677-1-jonathantanmy@google.com>
On 6/5/2019 3:26 PM, Jonathan Tan wrote:
Show 17 quoted lines
> 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.
Show 8 quoted lines
> -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

Previous: Jonathan TanNext: Jeff King
Message 2 of 3 in “t5551: test usage of chunked encoding explicitly”
  1. t5551: test usage of chunked encoding explicitlyJonathan Tan, Jun 5, 2019
  2. Derrick StoleeJun 5, 2019
  3. Jeff KingJun 5, 2019

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.