diff options
author | Niko Tyni <ntyni@debian.org> | 2022-02-11 22:42:09 +0200 |
---|---|---|
committer | Niko Tyni <ntyni@debian.org> | 2022-02-11 22:59:42 +0200 |
commit | 42cc4918c2daad3a1890741362069f4872863ffd (patch) | |
tree | 0d0b6db7dffeb15f2eed2ae07fed10c6e63061a9 | |
parent | b784410120f1889abada1c5007b1082c0ee931ad (diff) |
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
-rw-r--r-- | debian/patches/0001-future-io-syswrite-test-unclog-the-pipe-harder.patch | 39 | ||||
-rw-r--r-- | debian/patches/series | 1 |
2 files changed, 40 insertions, 0 deletions
diff --git a/debian/patches/0001-future-io-syswrite-test-unclog-the-pipe-harder.patch b/debian/patches/0001-future-io-syswrite-test-unclog-the-pipe-harder.patch new file mode 100644 index 0000000..5294594 --- /dev/null +++ b/debian/patches/0001-future-io-syswrite-test-unclog-the-pipe-harder.patch @@ -0,0 +1,39 @@ +From cc3da5f2cd9e137f95f42988129f741dc634d56c Mon Sep 17 00:00:00 2001 +From: Niko Tyni <ntyni@debian.org> +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 +--- + t/70future-io.t | 7 ++++++- + 1 file changed, 6 insertions(+), 1 deletion(-) + +diff --git a/t/70future-io.t b/t/70future-io.t +index ee9cf36..fd565bf 100644 +--- a/t/70future-io.t ++++ b/t/70future-io.t +@@ -56,7 +56,12 @@ testing_loop( IO::Async::Loop->new_builtin ); + + 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' ); + +-- +2.30.2 + diff --git a/debian/patches/series b/debian/patches/series new file mode 100644 index 0000000..17d8990 --- /dev/null +++ b/debian/patches/series @@ -0,0 +1 @@ +0001-future-io-syswrite-test-unclog-the-pipe-harder.patch |