{"thread":{"id":"40427","subject":"[PATCH] t5561: get rid of racy appending to logfile","startedAt":"2015-09-24T23:31:33Z","lastAt":"2015-09-25T17:44:03Z","messageCount":2,"participants":["Stephan Beyer","Junio C Hamano"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"270725","messageId":"1443137493-2648-1-git-send-email-s-beyer@gmx.net","threadId":"40427","inReplyTo":null,"subject":"[PATCH] t5561: get rid of racy appending to logfile","fromName":"Stephan Beyer","fromEmail":"s-beyer@gmx.net","sentAt":"2015-09-24T23:31:33Z","receivedAt":"2015-09-24T23:31:33Z","isPatch":true,"sender":{"key":"s-beyer@gmx.net","avatar":"https://avatars.githubusercontent.com/u/143889?v=4"},"body":"The definition of log_div() appended information to the web server's\nlogfile to make the test more readable. However, log_div() was called\nright after a request is served (which is done by git-http-backend);\nthe web server waits for the git-http-backend process to exit before\nit writes to the log file. When the duration between serving a request\nand exiting was long, the log_div() output was written before the last\nrequest's log, and the test failed. (This duration could become\nespecially long for PROFILE=GEN builds.)\n\nTo get rid of this behavior, we should not change the logfile at all.\nThis commit removes log_div() and its calls. The additional information\nis kept in the test (for readability reasons) but filtered out before\ncomparing it to the actual logfile.\n\nSigned-off-by: Stephan Beyer <s-beyer@gmx.net>\nAcked-by: Jeff King <peff@peff.net>\n---\n\n SubmittingPatches says that when there is consensus the patch has to\n be resent to Junio and cc'ed to the list. Here it is (although I\n don't know if there is consensus, but, hey, it's a rather trivial patch,\n so it should be okay).\n See http://git.661346.n2.nabble.com/t5561-failing-after-make-PROFILE-GEN-td7640150.html\n for the original thread.\n Compared to the last version, I only added the Acked-by line.\n\n t/t5560-http-backend-noserver.sh |  4 ----\n t/t5561-http-backend.sh          |  8 +-------\n t/t556x_common                   | 12 ------------\n 3 files changed, 1 insertion(+), 23 deletions(-)\n\ndiff --git a/t/t5560-http-backend-noserver.sh b/t/t5560-http-backend-noserver.sh\nindex aa73eea..9fafcf1 100755\n--- a/t/t5560-http-backend-noserver.sh\n+++ b/t/t5560-http-backend-noserver.sh\n@@ -44,10 +44,6 @@ POST() {\n \ttest_cmp exp act\n }\n \n-log_div() {\n-\treturn 0\n-}\n-\n . \"$TEST_DIRECTORY\"/t556x_common\n \n expect_aliased() {\ndiff --git a/t/t5561-http-backend.sh b/t/t5561-http-backend.sh\nindex 19afe96..73dcb29 100755\n--- a/t/t5561-http-backend.sh\n+++ b/t/t5561-http-backend.sh\n@@ -29,15 +29,9 @@ POST() {\n \ttest_cmp exp act\n }\n \n-log_div() {\n-\techo >>\"$HTTPD_ROOT_PATH\"/access.log\n-\techo \"###  $1\" >>\"$HTTPD_ROOT_PATH\"/access.log\n-\techo \"###\" >>\"$HTTPD_ROOT_PATH\"/access.log\n-}\n-\n . \"$TEST_DIRECTORY\"/t556x_common\n \n-cat >exp <<EOF\n+grep '^[^#]' >exp <<EOF\n \n ###  refs/heads/master\n ###\ndiff --git a/t/t556x_common b/t/t556x_common\nindex 82926cf..359fcfe 100755\n--- a/t/t556x_common\n+++ b/t/t556x_common\n@@ -52,21 +52,17 @@ get_static_files() {\n SMART=smart\n GIT_HTTP_EXPORT_ALL=1 && export GIT_HTTP_EXPORT_ALL\n test_expect_success 'direct refs/heads/master not found' '\n-\tlog_div \"refs/heads/master\" &&\n \tGET refs/heads/master \"404 Not Found\"\n '\n test_expect_success 'static file is ok' '\n-\tlog_div \"getanyfile default\" &&\n \tget_static_files \"200 OK\"\n '\n SMART=smart_noexport\n unset GIT_HTTP_EXPORT_ALL\n test_expect_success 'no export by default' '\n-\tlog_div \"no git-daemon-export-ok\" &&\n \tget_static_files \"404 Not Found\"\n '\n test_expect_success 'export if git-daemon-export-ok' '\n-\tlog_div \"git-daemon-export-ok\" &&\n         (cd \"$HTTPD_DOCUMENT_ROOT_PATH/repo.git\" &&\n \t touch git-daemon-export-ok\n \t) &&\n@@ -75,47 +71,39 @@ test_expect_success 'export if git-daemon-export-ok' '\n SMART=smart\n GIT_HTTP_EXPORT_ALL=1 && export GIT_HTTP_EXPORT_ALL\n test_expect_success 'static file if http.getanyfile true is ok' '\n-\tlog_div \"getanyfile true\" &&\n \tconfig http.getanyfile true &&\n \tget_static_files \"200 OK\"\n '\n test_expect_success 'static file if http.getanyfile false fails' '\n-\tlog_div \"getanyfile false\" &&\n \tconfig http.getanyfile false &&\n \tget_static_files \"403 Forbidden\"\n '\n \n test_expect_success 'http.uploadpack default enabled' '\n-\tlog_div \"uploadpack default\" &&\n \tGET info/refs?service=git-upload-pack \"200 OK\"  &&\n \tPOST git-upload-pack 0000 \"200 OK\"\n '\n test_expect_success 'http.uploadpack true' '\n-\tlog_div \"uploadpack true\" &&\n \tconfig http.uploadpack true &&\n \tGET info/refs?service=git-upload-pack \"200 OK\" &&\n \tPOST git-upload-pack 0000 \"200 OK\"\n '\n test_expect_success 'http.uploadpack false' '\n-\tlog_div \"uploadpack false\" &&\n \tconfig http.uploadpack false &&\n \tGET info/refs?service=git-upload-pack \"403 Forbidden\" &&\n \tPOST git-upload-pack 0000 \"403 Forbidden\"\n '\n \n test_expect_success 'http.receivepack default disabled' '\n-\tlog_div \"receivepack default\" &&\n \tGET info/refs?service=git-receive-pack \"403 Forbidden\"  &&\n \tPOST git-receive-pack 0000 \"403 Forbidden\"\n '\n test_expect_success 'http.receivepack true' '\n-\tlog_div \"receivepack true\" &&\n \tconfig http.receivepack true &&\n \tGET info/refs?service=git-receive-pack \"200 OK\" &&\n \tPOST git-receive-pack 0000 \"200 OK\"\n '\n test_expect_success 'http.receivepack false' '\n-\tlog_div \"receivepack false\" &&\n \tconfig http.receivepack false &&\n \tGET info/refs?service=git-receive-pack \"403 Forbidden\" &&\n \tPOST git-receive-pack 0000 \"403 Forbidden\"\n-- \n2.6.0.rc3.dirty\n"},{"id":"270759","messageId":"xmqqoagq4cnw.fsf@gitster.mtv.corp.google.com","threadId":"40427","inReplyTo":"1443137493-2648-1-git-send-email-s-beyer@gmx.net","subject":"Re: [PATCH] t5561: get rid of racy appending to logfile","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2015-09-25T17:44:03Z","receivedAt":"2015-09-25T17:44:03Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Stephan Beyer <s-beyer@gmx.net> writes:\n\n>  SubmittingPatches says that when there is consensus the patch has to\n>  be resent to Junio and cc'ed to the list. Here it is (although I\n>  don't know if there is consensus, but, hey, it's a rather trivial patch,\n>  so it should be okay).\n\nYup.\n\nThe patch text matches exactly what I already queued with\nReviewed-by from Peff earlier, which is good.  \n\nThanks.\n"}]}