Skip to content

Commit 376e4b3

Browse files
peffgitster
authored andcommitted
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 <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 9a308de commit 376e4b3

File tree

1 file changed

+14
-5
lines changed

1 file changed

+14
-5
lines changed

t/t5551-http-fetch-smart.sh

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -213,10 +213,10 @@ test_expect_success 'cookies stored in http.cookiefile when http.savecookies set
213213
test_cmp expect_cookies.txt cookies_tail.txt
214214
'
215215

216-
test_expect_success EXPENSIVE 'create 50,000 tags in the repo' '
216+
test_expect_success 'create 2,000 tags in the repo' '
217217
(
218218
cd "$HTTPD_DOCUMENT_ROOT_PATH/repo.git" &&
219-
for i in `test_seq 50000`
219+
for i in $(test_seq 2000)
220220
do
221221
echo "commit refs/heads/too-many-refs"
222222
echo "mark :$i"
@@ -237,13 +237,22 @@ test_expect_success EXPENSIVE 'create 50,000 tags in the repo' '
237237
)
238238
'
239239

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 &&
242243
(
243244
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
245247
)
246248
'
247249

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+
248257
stop_httpd
249258
test_done

0 commit comments

Comments
 (0)