Skip to content

Commit 07da4e0

Browse files
committed
Merge branch 'jk/test-annoyances'
Test fixes. * jk/test-annoyances: t5551: make EXPENSIVE test cheaper t5541: move run_with_cmdline_limit to test-lib.sh t: pass GIT_TRACE through Apache t: redirect stderr GIT_TRACE to descriptor 4 t: translate SIGINT to an exit
2 parents c12eca7 + 376e4b3 commit 07da4e0

File tree

5 files changed

+24
-15
lines changed

5 files changed

+24
-15
lines changed

t/lib-httpd.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,7 @@ HTTPD_DOCUMENT_ROOT_PATH=$HTTPD_ROOT_PATH/www
7979
# hack to suppress apache PassEnv warnings
8080
GIT_VALGRIND=$GIT_VALGRIND; export GIT_VALGRIND
8181
GIT_VALGRIND_OPTIONS=$GIT_VALGRIND_OPTIONS; export GIT_VALGRIND_OPTIONS
82+
GIT_TRACE=$GIT_TRACE; export GIT_TRACE
8283

8384
if ! test -x "$LIB_HTTPD_PATH"
8485
then

t/lib-httpd/apache.conf

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@ PassEnv GIT_VALGRIND
7070
PassEnv GIT_VALGRIND_OPTIONS
7171
PassEnv GNUPGHOME
7272
PassEnv ASAN_OPTIONS
73+
PassEnv GIT_TRACE
7374

7475
Alias /dumb/ www/
7576
Alias /auth/dumb/ www/auth/dumb/

t/t5541-http-push-smart.sh

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -324,12 +324,6 @@ test_expect_success 'push into half-auth-complete requires password' '
324324
test_cmp expect actual
325325
'
326326

327-
run_with_limited_cmdline () {
328-
(ulimit -s 128 && "$@")
329-
}
330-
331-
test_lazy_prereq CMDLINE_LIMIT 'run_with_limited_cmdline true'
332-
333327
test_expect_success CMDLINE_LIMIT 'push 2000 tags over http' '
334328
sha1=$(git rev-parse HEAD) &&
335329
test_seq 2000 |

t/t5551-http-fetch-smart.sh

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -224,10 +224,10 @@ test_expect_success 'transfer.hiderefs works over smart-http' '
224224
git -C hidden.git rev-parse --verify b
225225
'
226226

227-
test_expect_success EXPENSIVE 'create 50,000 tags in the repo' '
227+
test_expect_success 'create 2,000 tags in the repo' '
228228
(
229229
cd "$HTTPD_DOCUMENT_ROOT_PATH/repo.git" &&
230-
for i in `test_seq 50000`
230+
for i in $(test_seq 2000)
231231
do
232232
echo "commit refs/heads/too-many-refs"
233233
echo "mark :$i"
@@ -248,13 +248,22 @@ test_expect_success EXPENSIVE 'create 50,000 tags in the repo' '
248248
)
249249
'
250250

251-
test_expect_success EXPENSIVE 'clone the 50,000 tag repo to check OS command line overflow' '
252-
git clone $HTTPD_URL/smart/repo.git too-many-refs &&
251+
test_expect_success CMDLINE_LIMIT \
252+
'clone the 2,000 tag repo to check OS command line overflow' '
253+
run_with_limited_cmdline git clone $HTTPD_URL/smart/repo.git too-many-refs &&
253254
(
254255
cd too-many-refs &&
255-
test $(git for-each-ref refs/tags | wc -l) = 50000
256+
git for-each-ref refs/tags >actual &&
257+
test_line_count = 2000 actual
256258
)
257259
'
258260

261+
test_expect_success 'large fetch-pack requests can be split across POSTs' '
262+
GIT_CURL_VERBOSE=1 git -c http.postbuffer=65536 \
263+
clone --bare "$HTTPD_URL/smart/repo.git" split.git 2>err &&
264+
grep "^> POST" err >posts &&
265+
test_line_count = 2 posts
266+
'
267+
259268
stop_httpd
260269
test_done

t/test-lib.sh

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -152,10 +152,7 @@ unset UNZIP
152152

153153
case $(echo $GIT_TRACE |tr "[A-Z]" "[a-z]") in
154154
1|2|true)
155-
echo "* warning: Some tests will not work if GIT_TRACE" \
156-
"is set as to trace on STDERR ! *"
157-
echo "* warning: Please set GIT_TRACE to something" \
158-
"other than 1, 2 or true ! *"
155+
GIT_TRACE=4
159156
;;
160157
esac
161158

@@ -299,6 +296,7 @@ die () {
299296

300297
GIT_EXIT_OK=
301298
trap 'die' EXIT
299+
trap 'exit $?' INT
302300

303301
# The user-facing functions are loaded from a separate file so that
304302
# test_perf subshells can have them too
@@ -1064,3 +1062,9 @@ test_lazy_prereq UNZIP '
10641062
"$GIT_UNZIP" -v
10651063
test $? -ne 127
10661064
'
1065+
1066+
run_with_limited_cmdline () {
1067+
(ulimit -s 128 && "$@")
1068+
}
1069+
1070+
test_lazy_prereq CMDLINE_LIMIT 'run_with_limited_cmdline true'

0 commit comments

Comments
 (0)