Skip to content

Commit 8f6f177

Browse files
committed
Merge branch 'sb/http-flaky-test-fix' into maint
A test script for the HTTP service had a timing dependent bug, which was fixed. * sb/http-flaky-test-fix: t5561: get rid of racy appending to logfile
2 parents 2c3cb52 + 362d8b6 commit 8f6f177

File tree

3 files changed

+1
-23
lines changed

3 files changed

+1
-23
lines changed

t/t5560-http-backend-noserver.sh

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -44,10 +44,6 @@ POST() {
4444
test_cmp exp act
4545
}
4646

47-
log_div() {
48-
return 0
49-
}
50-
5147
. "$TEST_DIRECTORY"/t556x_common
5248

5349
expect_aliased() {

t/t5561-http-backend.sh

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -29,15 +29,9 @@ POST() {
2929
test_cmp exp act
3030
}
3131

32-
log_div() {
33-
echo >>"$HTTPD_ROOT_PATH"/access.log
34-
echo "### $1" >>"$HTTPD_ROOT_PATH"/access.log
35-
echo "###" >>"$HTTPD_ROOT_PATH"/access.log
36-
}
37-
3832
. "$TEST_DIRECTORY"/t556x_common
3933

40-
cat >exp <<EOF
34+
grep '^[^#]' >exp <<EOF
4135

4236
### refs/heads/master
4337
###

t/t556x_common

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -52,21 +52,17 @@ get_static_files() {
5252
SMART=smart
5353
GIT_HTTP_EXPORT_ALL=1 && export GIT_HTTP_EXPORT_ALL
5454
test_expect_success 'direct refs/heads/master not found' '
55-
log_div "refs/heads/master" &&
5655
GET refs/heads/master "404 Not Found"
5756
'
5857
test_expect_success 'static file is ok' '
59-
log_div "getanyfile default" &&
6058
get_static_files "200 OK"
6159
'
6260
SMART=smart_noexport
6361
unset GIT_HTTP_EXPORT_ALL
6462
test_expect_success 'no export by default' '
65-
log_div "no git-daemon-export-ok" &&
6663
get_static_files "404 Not Found"
6764
'
6865
test_expect_success 'export if git-daemon-export-ok' '
69-
log_div "git-daemon-export-ok" &&
7066
(cd "$HTTPD_DOCUMENT_ROOT_PATH/repo.git" &&
7167
touch git-daemon-export-ok
7268
) &&
@@ -75,47 +71,39 @@ test_expect_success 'export if git-daemon-export-ok' '
7571
SMART=smart
7672
GIT_HTTP_EXPORT_ALL=1 && export GIT_HTTP_EXPORT_ALL
7773
test_expect_success 'static file if http.getanyfile true is ok' '
78-
log_div "getanyfile true" &&
7974
config http.getanyfile true &&
8075
get_static_files "200 OK"
8176
'
8277
test_expect_success 'static file if http.getanyfile false fails' '
83-
log_div "getanyfile false" &&
8478
config http.getanyfile false &&
8579
get_static_files "403 Forbidden"
8680
'
8781

8882
test_expect_success 'http.uploadpack default enabled' '
89-
log_div "uploadpack default" &&
9083
GET info/refs?service=git-upload-pack "200 OK" &&
9184
POST git-upload-pack 0000 "200 OK"
9285
'
9386
test_expect_success 'http.uploadpack true' '
94-
log_div "uploadpack true" &&
9587
config http.uploadpack true &&
9688
GET info/refs?service=git-upload-pack "200 OK" &&
9789
POST git-upload-pack 0000 "200 OK"
9890
'
9991
test_expect_success 'http.uploadpack false' '
100-
log_div "uploadpack false" &&
10192
config http.uploadpack false &&
10293
GET info/refs?service=git-upload-pack "403 Forbidden" &&
10394
POST git-upload-pack 0000 "403 Forbidden"
10495
'
10596

10697
test_expect_success 'http.receivepack default disabled' '
107-
log_div "receivepack default" &&
10898
GET info/refs?service=git-receive-pack "403 Forbidden" &&
10999
POST git-receive-pack 0000 "403 Forbidden"
110100
'
111101
test_expect_success 'http.receivepack true' '
112-
log_div "receivepack true" &&
113102
config http.receivepack true &&
114103
GET info/refs?service=git-receive-pack "200 OK" &&
115104
POST git-receive-pack 0000 "200 OK"
116105
'
117106
test_expect_success 'http.receivepack false' '
118-
log_div "receivepack false" &&
119107
config http.receivepack false &&
120108
GET info/refs?service=git-receive-pack "403 Forbidden" &&
121109
POST git-receive-pack 0000 "403 Forbidden"

0 commit comments

Comments
 (0)