From patchwork Mon Feb 18 20:50:28 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Max Kirillov X-Patchwork-Id: 10818835 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 600B1922 for ; Mon, 18 Feb 2019 20:50:40 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4FA6D2B968 for ; Mon, 18 Feb 2019 20:50:40 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 438262B7BC; Mon, 18 Feb 2019 20:50: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 D79352B961 for ; Mon, 18 Feb 2019 20:50:39 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729750AbfBRUui (ORCPT ); Mon, 18 Feb 2019 15:50:38 -0500 Received: from p3plsmtpa07-01.prod.phx3.secureserver.net ([173.201.192.230]:38961 "EHLO p3plsmtpa07-01.prod.phx3.secureserver.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727682AbfBRUuh (ORCPT ); Mon, 18 Feb 2019 15:50:37 -0500 Received: from jessie.local ([212.149.203.197]) by :SMTPAUTH: with ESMTPSA id vps0ginbXAlQNvps3gVCe9; Mon, 18 Feb 2019 13:50:37 -0700 From: Max Kirillov To: =?utf-8?q?SZEDER_G=C3=A1bor?= , git@vger.kernel.org Cc: Max Kirillov , Johannes Schindelin , "Randall S. Becker" , 'Junio C Hamano' Subject: [PATCH] t5562: chunked sleep to avoid lost SIGCHILD Date: Mon, 18 Feb 2019 22:50:28 +0200 Message-Id: <20190218205028.32486-1-max@max630.net> X-Mailer: git-send-email 2.19.0.1202.g68e1e8f04e In-Reply-To: <20190215130213.GK1622@szeder.dev> References: MIME-Version: 1.0 X-CMAE-Envelope: MS4wfM0VbMkelwd3oLxJLcCAlr7CBsgwVSn/XLxPXQ+QPVXzXnTkbyEKxpxPo+UfkJFbRC2GIdGHy/mdmrlFwBoFos3ZHGrD5ZyRl/qpi67re8Uu+JkjLPPa E3F7Q7Hv7OI34ngg4aXoulkGk8prUcYFwtDo/ulVCQLuN+PlI0oSDGM2zmYUju7sbHkw3YVJt+WNeqSoKnpPfb2hyDxn2CUasQXhg3/QnjtptDUZOWiMJlDD NiPEMbt5JikcD934LBooLYqG9NQ2JJAoEaJ6Aov37qk7zZU666FsU5FCkXQvG+AzGCO1n0Ezk3UQPq/4FXSS7mPi3buheS1QKzSYcUbdxIw= Sender: git-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP If was found during stress-test run that a test may hang by 60 seconds. It supposedly happens because SIGCHILD was received before sleep has started. Fix by looping by smaller chunks, checking $exited after each of them. Then lost SIGCHILD would not cause longer delay than 1 second. Reported-by: SZEDER Gábor Signed-off-by: Max Kirillov --- Submitting as proper patch. Note: I believe it does not relate to other issues discussed in this thread. t/t5562/invoke-with-content-length.pl | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/t/t5562/invoke-with-content-length.pl b/t/t5562/invoke-with-content-length.pl index 0943474af2..257e280e3b 100644 --- a/t/t5562/invoke-with-content-length.pl +++ b/t/t5562/invoke-with-content-length.pl @@ -29,7 +29,12 @@ } print $out $body_data or die "Cannot write data: $!"; -sleep 60; # is interrupted by SIGCHLD +my $counter = 0; +while (not $exited and $counter < 60) { + sleep 1; + $counter = $counter + 1; +} + if (!$exited) { close($out); die "Command did not exit after reading whole body";