From cc3da5f2cd9e137f95f42988129f741dc634d56c Mon Sep 17 00:00:00 2001 From: Niko Tyni Date: Fri, 11 Feb 2022 22:42:09 +0200 Subject: [PATCH] future-io syswrite test: unclog the pipe harder Reading out 4 kB from a full pipe is not enough to unblock it on all systems. On Linux, the pipe size is by default 16 * page size, and at least the Debian (and apparently Alpine too) ppc64le port has a page size of 64 kB instead of the more usual 4 kB. Bug: https://rt.cpan.org/Ticket/Display.html?id=140021 Bug-Debian: https://bugs.debian.org/1002541 Last-Update: 2026-01-21 --- t/70future-io.t | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) --- a/t/70future-io.t +++ b/t/70future-io.t @@ -57,7 +57,12 @@ my $f = Future::IO->syswrite( $wr, "ABCD" ); - $rd->sysread( my $buf, 4096 ); + my $n = 0; + # read as long as the pipe still blocks + $rd->sysread( my $buf, 4096 ) and $n++ while !$wr->syswrite( "X" x 4096) + and ($! == Errno::EAGAIN or $! == Errno::EWOULDBLOCK); + # now we know how much we need to read out to unblock + $rd->sysread( $buf, 4096 ) for 1..$n; is( ( wait_for_future $f )->get, 4, 'Future::IO->syswrite' );