From: Junio C Hamano Date: Tue, 26 May 2015 03:44:04 +0000 (-0700) Subject: Merge branch 'jk/http-backend-deadlock-2.2' into jk/http-backend-deadlock-2.3 X-Git-Tag: v2.4.4~9^2^2 X-Git-Url: https://git.lorimer.id.au/gitweb.git/diff_plain/7419a03fdb3f4f1e6e78debf34a084533512c24a?hp=-c Merge branch 'jk/http-backend-deadlock-2.2' into jk/http-backend-deadlock-2.3 * jk/http-backend-deadlock-2.2: http-backend: spool ref negotiation requests to buffer t5551: factor out tag creation http-backend: fix die recursion with custom handler --- 7419a03fdb3f4f1e6e78debf34a084533512c24a diff --combined t/t5551-http-fetch-smart.sh index 7f6eb9f3db,2d8e5a0fbe..1cca683290 --- a/t/t5551-http-fetch-smart.sh +++ b/t/t5551-http-fetch-smart.sh @@@ -213,46 -213,56 +213,69 @@@ test_expect_success 'cookies stored in test_cmp expect_cookies.txt cookies_tail.txt ' - test_expect_success 'create 2,000 tags in the repo' ' - ( - cd "$HTTPD_DOCUMENT_ROOT_PATH/repo.git" && - for i in $(test_seq 2000) + # create an arbitrary number of tags, numbered from tag-$1 to tag-$2 + create_tags () { + rm -f marks && + for i in $(test_seq "$1" "$2") do - echo "commit refs/heads/too-many-refs" - echo "mark :$i" - echo "committer git $i +0000" - echo "data 0" - echo "M 644 inline bla.txt" - echo "data 4" - echo "bla" + # don't use here-doc, because it requires a process + # per loop iteration + echo "commit refs/heads/too-many-refs-$1" && + echo "mark :$i" && + echo "committer git $i +0000" && + echo "data 0" && + echo "M 644 inline bla.txt" && + echo "data 4" && + echo "bla" && # make every commit dangling by always # rewinding the branch after each commit - echo "reset refs/heads/too-many-refs" - echo "from :1" + echo "reset refs/heads/too-many-refs-$1" && + echo "from :$1" done | git fast-import --export-marks=marks && # now assign tags to all the dangling commits we created above tag=$(perl -e "print \"bla\" x 30") && sed -e "s|^:\([^ ]*\) \(.*\)$|\2 refs/tags/$tag-\1|" >packed-refs + } + -test_expect_success 'create 50,000 tags in the repo' ' ++test_expect_success 'create 2,000 tags in the repo' ' + ( + cd "$HTTPD_DOCUMENT_ROOT_PATH/repo.git" && - create_tags 1 50000 ++ create_tags 1 2000 ) ' -test_expect_success EXPENSIVE 'clone the 50,000 tag repo to check OS command line overflow' ' - git clone $HTTPD_URL/smart/repo.git too-many-refs && +test_expect_success CMDLINE_LIMIT \ + 'clone the 2,000 tag repo to check OS command line overflow' ' + run_with_limited_cmdline git clone $HTTPD_URL/smart/repo.git too-many-refs && ( cd too-many-refs && - test $(git for-each-ref refs/tags | wc -l) = 50000 + git for-each-ref refs/tags >actual && + test_line_count = 2000 actual ) ' +test_expect_success 'large fetch-pack requests can be split across POSTs' ' + GIT_CURL_VERBOSE=1 git -c http.postbuffer=65536 \ + clone --bare "$HTTPD_URL/smart/repo.git" split.git 2>err && + grep "^> POST" err >posts && + test_line_count = 2 posts +' + + test_expect_success EXPENSIVE 'http can handle enormous ref negotiation' ' ++ ( ++ cd "$HTTPD_DOCUMENT_ROOT_PATH/repo.git" && ++ create_tags 2001 50000 ++ ) && + git -C too-many-refs fetch -q --tags && + ( + cd "$HTTPD_DOCUMENT_ROOT_PATH/repo.git" && + create_tags 50001 100000 + ) && + git -C too-many-refs fetch -q --tags && + git -C too-many-refs for-each-ref refs/tags >tags && + test_line_count = 100000 tags + ' + stop_httpd test_done