t5551: make EXPENSIVE test cheaper

We create 50,000 tags to check that we don't overflow the command-line of fetch-pack. But by using run_with_cmdline_limit, we can get the same effect with a much smaller number of tags. This makes the test fast enough that we can drop the EXPENSIVE prereq, which means people will actually run it. It was not documented to do so, but this test was also the only test of a clone-over-http that requires multiple POSTs during the conversation. We can continue to test that by dropping http.postbuffer to its minimum size, and checking that we get two POSTs. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Jeff King committed Mar 13, 2015 at 00:57 UTC 376e4b39d4453ce50cbacc9c46a3bbdaad2134b2
1 file changed +14 -5
t/t5551-http-fetch-smart.sh
+14 -5
@@ -213,10 +213,10 @@ test_expect_success 'cookies stored in http.cookiefile when http.savecookies set
213 test_cmp expect_cookies.txt cookies_tail.txt
214 '
215
216 -test_expect_success EXPENSIVE 'create 50,000 tags in the repo' '
216 +test_expect_success 'create 2,000 tags in the repo' '
217 (
218 cd "$HTTPD_DOCUMENT_ROOT_PATH/repo.git" &&
219 - for i in `test_seq 50000`
219 + for i in $(test_seq 2000)
220 do
221 echo "commit refs/heads/too-many-refs"
222 echo "mark :$i"
@@ -237,13 +237,22 @@ test_expect_success EXPENSIVE 'create 50,000 tags in the repo' '
237 )
238 '
239
240 -test_expect_success EXPENSIVE 'clone the 50,000 tag repo to check OS command line overflow' '
241 - git clone $HTTPD_URL/smart/repo.git too-many-refs &&
240 +test_expect_success CMDLINE_LIMIT \
241 + 'clone the 2,000 tag repo to check OS command line overflow' '
242 + run_with_limited_cmdline git clone $HTTPD_URL/smart/repo.git too-many-refs &&
243 (
244 cd too-many-refs &&
244 - test $(git for-each-ref refs/tags | wc -l) = 50000
245 + git for-each-ref refs/tags >actual &&
246 + test_line_count = 2000 actual
247 )
248 '
249
250 +test_expect_success 'large fetch-pack requests can be split across POSTs' '
251 + GIT_CURL_VERBOSE=1 git -c http.postbuffer=65536 \
252 + clone --bare "$HTTPD_URL/smart/repo.git" split.git 2>err &&
253 + grep "^> POST" err >posts &&
254 + test_line_count = 2 posts
255 +'
256 +
257 stop_httpd
258 test_done