]> git.ipfire.org Git - thirdparty/public-inbox.git/commitdiff
t/v2writable: avoid failure on strace un-readyiness
authorEric Wong <e@80x24.org>
Fri, 30 Aug 2024 19:05:29 +0000 (19:05 +0000)
committerEric Wong <e@80x24.org>
Sat, 31 Aug 2024 01:10:18 +0000 (01:10 +0000)
poll(2) uses milliseconds, IO::Poll::_poll doesn't abstract that,
nor does our ->poll_in wrapper.  This ensures we wait enough time
for strace to start up on overloaded systems.

t/v2writable.t

index 496eba2cef4133e95be3da25cb56f6bc057e8abd..4c24ee924e203449501f603c222c65c2860af7f5 100644 (file)
@@ -343,7 +343,7 @@ SKIP: {
        open my $fh, '>', my $trace = "$inboxdir/trace.out";
        my $rd = popen_rd([ $strace, '-p', $$, '-o', $trace,
                '-e', 'inject=pwrite64:error=ENOSPC'], undef, { 2 => 1 });
-       $rd->poll_in(10) or die 'strace not ready';
+       $rd->poll_in(10_000) or die 'strace not ready';
        ok ! eval {
                open my $olderr, '>&', \*STDERR;
                open STDERR, '>>', $gfi_err;
@@ -362,7 +362,7 @@ SKIP: {
        $rd = popen_rd([$strace, '-p', $pid, '-o', $trace,
                '-e', 'inject=write:error=ENOSPC:when=1'],
                undef, { 2 => 1 });
-       $rd->poll_in(10) or die 'strace not ready';
+       $rd->poll_in(10_000) or die 'strace not ready';
        ok !eval { $im->done }, 'done fails with ENOSPC';
        ok $@, '$@ set on ENOSPC';
        kill 'TERM', $rd->attached_pid;