From patchwork Sat Nov 24 07:04:28 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Max Kirillov X-Patchwork-Id: 10696421 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 24BB916B1 for ; Sat, 24 Nov 2018 07:04:41 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0618628A05 for ; Sat, 24 Nov 2018 07:04:41 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E93F72AEC6; Sat, 24 Nov 2018 07:04:40 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5638328A05 for ; Sat, 24 Nov 2018 07:04:40 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726778AbeKXRv6 (ORCPT ); Sat, 24 Nov 2018 12:51:58 -0500 Received: from p3plsmtpa11-09.prod.phx3.secureserver.net ([68.178.252.110]:54392 "EHLO p3plsmtpa11-09.prod.phx3.secureserver.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726048AbeKXRv6 (ORCPT ); Sat, 24 Nov 2018 12:51:58 -0500 Received: from jessie.local ([212.149.203.197]) by :SMTPAUTH: with ESMTPSA id QRzSgP2BnkXzSQRzWgUmqH; Sat, 24 Nov 2018 00:04:35 -0700 From: Max Kirillov To: Carlo Arenas , git@vger.kernel.org Cc: Max Kirillov , peff@peff.net Subject: [PATCH] t5562: do not reuse output files Date: Sat, 24 Nov 2018 09:04:28 +0200 Message-Id: <20181124070428.18571-1-max@max630.net> X-Mailer: git-send-email 2.19.0.1202.g68e1e8f04e In-Reply-To: References: MIME-Version: 1.0 X-CMAE-Envelope: MS4wfH+X1TFNxxvG0iyw3kl7XlJ+2bpf10HndJZ2wUaaTKIGM1ELfQm1rc4VQgljxS0beIgnPTJj+6ZnERaa0KCbzlWLeDmRfhvTlm8bWBuUVdr4u67FmC4u dJrywSJus58nUDsqKrEnH/vvZvJPgPwqd+3f3IwDEsFZwmW8knG+d4RGo98rey0qlT/IojFVQyVa4o6ORXVJ2LQKC6/zd7KkXPgWhNKYO9vzypccVFyQSFl7 Qg74mop89H5fAS3iBB/0Ew== Sender: git-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Some expected failures of git-http-backend leave running its children (receive-pack or upload-pack) which still hold opened descriptors to act.err and with some probability they live long enough to write their failure messages after next test has already truncated the files. This causes occasional failures of the test script. Avoid the issue by unlinking the older files before writing to them. Reported-by: Carlo Arenas Helped-by: Carlo Arenas Signed-off-by: Max Kirillov --- Thanks for the analysis. I seem to have guessed the reason. This patch should prevent it. I think the tests should somehow make sure there are no such late processes. I can see 2 options: * somehow find out in the tests all children and wait for them. I have no idea how. * make http-backend close handle to its child and wait for it to exit before dying. This would not prevent childrenc in general, because http-backend may be killed, but not in our expected failure cases Actually, don't the children receive some SIGHUP? Maybe thy should. However, it would still take some time for them to handle it, so it does not fully solve the issue t/t5562-http-backend-content-length.sh | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/t/t5562-http-backend-content-length.sh b/t/t5562-http-backend-content-length.sh index 90d890d02f..bb53f82c0c 100755 --- a/t/t5562-http-backend-content-length.sh +++ b/t/t5562-http-backend-content-length.sh @@ -25,6 +25,8 @@ test_http_env() { handler_type="$1" request_body="$2" shift + (rm -f act.out || true) && + (rm -f act.err || true) && env \ CONTENT_TYPE="application/x-git-$handler_type-pack-request" \ QUERY_STRING="/repo.git/git-$handler_type-pack" \ @@ -155,6 +157,8 @@ test_expect_success 'CONTENT_LENGTH overflow ssite_t' ' ' test_expect_success 'empty CONTENT_LENGTH' ' + (rm -f act.out || true) && + (rm -f act.err || true) && env \ QUERY_STRING="service=git-receive-pack" \ PATH_TRANSLATED="$PWD"/.git/info/refs \