From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: X-Spam-Status: No, score=-4.2 required=3.0 tests=ALL_TRUSTED,AWL,BAYES_00, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF shortcircuit=no autolearn=ham autolearn_force=no version=3.4.6 Received: from localhost (dcvr.yhbt.net [127.0.0.1]) by dcvr.yhbt.net (Postfix) with ESMTP id 2403A1F4C8 for ; Mon, 11 Nov 2024 21:56:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=80x24.org; s=selector1; t=1731362217; bh=MOrfBMr49ggwwcPs8M0hw/wJphqzkQj7QVOseUiDTEg=; h=From:To:Subject:Date:In-Reply-To:References:From; b=Bzmp34akWjEMjsR/WLTTd7LoMDpoqvy74rhmwXZm7Oa6/eQNsopZNp9dEICo3FJ3s RfwWIq2bh79jG/qcdLn73jCtnw7IctZkoIMoUxmZC3R+h6TVN5FkpSvhwre1nasCxq 8nYZv+M5rw4rt5UjxTzqkByyCQTLUE5hLZwWrve0= From: Eric Wong To: meta@public-inbox.org Subject: [PATCH 2/4] t/spawn: increase timeout for slow systems Date: Mon, 11 Nov 2024 21:56:54 +0000 Message-ID: <20241111215656.2411957-3-e@80x24.org> In-Reply-To: <20241111215656.2411957-1-e@80x24.org> References: <20241111215656.2411957-1-e@80x24.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit List-Id: Smetimes the SIGXCPU handler doesn't fire in time on an overloaded VPS, so hopefully increasing the timeout is now enough. The $rset allocation and bitset is now moved before the spawn to avoid measuring any possible overhead from the scalar creation. --- t/spawn.t | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/t/spawn.t b/t/spawn.t index 45517852..36f4ed2e 100644 --- a/t/spawn.t +++ b/t/spawn.t @@ -228,11 +228,10 @@ EOM pipe(my($r, $w)) or die "pipe: $!"; my $fd = fileno($w); my $opt = { RLIMIT_CPU => [ 1, 9 ], RLIMIT_CORE => [ 0, 0 ], 1 => $fd }; + vec(my $rset = '', fileno($r), 1) = 1; my $pid = spawn($cmd, undef, $opt); close $w or die "close(w): $!"; - my $rset = ''; - vec($rset, fileno($r), 1) = 1; - ok(select($rset, undef, undef, 5), 'child died before timeout'); + ok(select($rset, undef, undef, 8), 'child died before timeout'); is(waitpid($pid, 0), $pid, 'XCPU child process reaped'); my $line; like($line = readline($r), qr/SIGXCPU/, 'SIGXCPU handled') or