]> git.ipfire.org Git - thirdparty/public-inbox.git/commitdiff
t/spawn: increase timeout for slow systems
authorEric Wong <e@80x24.org>
Mon, 11 Nov 2024 21:56:54 +0000 (21:56 +0000)
committerEric Wong <e@80x24.org>
Tue, 12 Nov 2024 20:13:13 +0000 (20:13 +0000)
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

index 45517852da70b3a2879ba77bc9deeaabe128a45d..36f4ed2e595ee1a5f0496921172814936ed686a8 100644 (file)
--- 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