From: Eric Wong Date: Mon, 11 Nov 2024 21:56:54 +0000 (+0000) Subject: t/spawn: increase timeout for slow systems X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6a1fa90dd05628772ca7d88a93b5a80f986b94cb;p=thirdparty%2Fpublic-inbox.git t/spawn: increase timeout for slow systems 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. --- diff --git a/t/spawn.t b/t/spawn.t index 45517852d..36f4ed2e5 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