From mboxrd@z Thu Jan 1 00:00:00 1970 From: Stephan Beyer Subject: [PATCH] t5561: get rid of racy appending to logfile Date: Thu, 24 Sep 2015 20:12:22 +0200 Message-ID: <1443118342-3856-1-git-send-email-s-beyer@gmx.net> References: <20150924014541.GB6442@sigill.intra.peff.net> Cc: git@vger.kernel.org, Tarmigan Casebolt , Stephan Beyer To: Jeff King X-From: git-owner@vger.kernel.org Thu Sep 24 20:14:27 2015 Return-path: Envelope-to: gcvg-git-2@plane.gmane.org Received: from vger.kernel.org ([209.132.180.67]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1ZfB2D-0001J6-VB for gcvg-git-2@plane.gmane.org; Thu, 24 Sep 2015 20:14:22 +0200 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757228AbbIXSOR (ORCPT ); Thu, 24 Sep 2015 14:14:17 -0400 Received: from mout.gmx.net ([212.227.15.19]:65264 "EHLO mout.gmx.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756774AbbIXSOP (ORCPT ); Thu, 24 Sep 2015 14:14:15 -0400 Received: from fermat.fritz.box ([92.76.227.98]) by mail.gmx.com (mrgmx003) with ESMTPSA (Nemesis) id 0MQ33z-1ZkNxX3aJ1-005G3C; Thu, 24 Sep 2015 20:14:12 +0200 X-Mailer: git-send-email 2.6.0.rc3.dirty In-Reply-To: <20150924014541.GB6442@sigill.intra.peff.net> X-Provags-ID: V03:K0:x+CvT7el7LwII8XTZDIJQZOs0LGUT4N2Nj7Htqkxky31Auah/Xw 4iKviCFkwayt/jBugSHPO/Z5KXO4uPQhNtVlbBD9AefvDTJb1N2jEyOrOieKe7xVvLAqDAe FkqG0F4mrl0wjw7gDGBjwmrnedbszQei3wlBoK/5S9obeX9Fcds4EyKU3hzGOSpyjSARWIb kfq2i/TuKJPfvhWyeIXhA== X-UI-Out-Filterresults: notjunk:1;V01:K0:UaqPXZVLzU0=:uIcD8WlkaNglV4pWahlIRa 59oisiK/NmD5XbIQamIgGZfx3fP9ETyawCta6POr6A+dF8cF6RrM5JBj3zT7GgNwNGhyn76H+ e8GoqGk2XyEPJqT6ZWAA+2ohBZphej/NXDd4qnFZ2ginw7FPBf29nv3/3RkWNnI/aKVq5vGl8 VuwDsTPx1ABStkvUWHhL2aLDSuHA9twCh7tSK+ZFUcuTzO1kz6Ti40wZHMrsPRTQUWx6IsA64 aYmKeCKVjAiJnmbqQ83Vt+EvjHzyykzSLeB56b54lov41rVZnAz5oN+8reL8elpeqwapNUpVq NV7dth0BIMVFg29Vj4SH4r84wDnmu5Hd5ZMpparAaPPe77AS7dkovLB0vKaCcpkwRnQ2pum// RM2H5gsIMrdIr2xYIfDD5EHgBwGm8uy9GiwNdBu/qClSHS73z1kvZmZyufS9dmUsQbLdkm6Bz 95MwGzVPNWRh/m4DX5R26wGfHzcSbqmarwbFfsohMh+VdXruIJjkimAeLP7vkD9ijEPoComyC 9lC7nVU6ZJ++6XUqVNrFANcw5DUz06xtPueApSMVBob0hslaLJe1oPOl+kJxnY/qlkzFWG5nF /GCIIUUjshOZR9NCewqYaFrN6cNKz+JIMfgDv0ZHFAk4K2hqlSM/vSxh5Kun2z6gBCyEypvQE MqaiuYdtnUTKYwOLk1PTgSGZ+Yf40yaBZgc627257Yq5WK6majsN6qAO+lOQowUNd1QPQAOcd 43UBIuN6oD3xb2o/ Sender: git-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org Archived-At: The definition of log_div() appended information to the web server's logfile to make the test more readable. However, log_div() was called right after a request is served (which is done by git-http-backend); the web server waits for the git-http-backend process to exit before it writes to the log file. When the duration between serving a request and exiting was long, the log_div() output was written before the last request's log, and the test failed. (This duration could become especially long for PROFILE=GEN builds.) To get rid of this behavior, we should not change the logfile at all. This commit removes log_div() and its calls. The additional information is kept in the test (for readability reasons) but filtered out before comparing it to the actual logfile. Signed-off-by: Stephan Beyer --- Okay Peff, I added the information to the commit message (in my own words). Past tense for the situation before the patch, present tense for the situation after (hope that's right but should not be too important). I also used your proposed grep line because it is probably more robust. t/t5560-http-backend-noserver.sh | 4 ---- t/t5561-http-backend.sh | 8 +------- t/t556x_common | 12 ------------ 3 files changed, 1 insertion(+), 23 deletions(-) diff --git a/t/t5560-http-backend-noserver.sh b/t/t5560-http-backend-noserver.sh index aa73eea..9fafcf1 100755 --- a/t/t5560-http-backend-noserver.sh +++ b/t/t5560-http-backend-noserver.sh @@ -44,10 +44,6 @@ POST() { test_cmp exp act } -log_div() { - return 0 -} - . "$TEST_DIRECTORY"/t556x_common expect_aliased() { diff --git a/t/t5561-http-backend.sh b/t/t5561-http-backend.sh index 19afe96..73dcb29 100755 --- a/t/t5561-http-backend.sh +++ b/t/t5561-http-backend.sh @@ -29,15 +29,9 @@ POST() { test_cmp exp act } -log_div() { - echo >>"$HTTPD_ROOT_PATH"/access.log - echo "### $1" >>"$HTTPD_ROOT_PATH"/access.log - echo "###" >>"$HTTPD_ROOT_PATH"/access.log -} - . "$TEST_DIRECTORY"/t556x_common -cat >exp <exp <