From ae88accf6fe3817ff42d0d51be1965071194766e Mon Sep 17 00:00:00 2001 From: Michael Stapelberg Date: Sun, 12 Aug 2012 00:22:17 +0200 Subject: [PATCH] testworker: handle EAGAIN Hopefully this fixes the case where a testworker would die and leave the whole testsuite run hanging in the air, never completing. --- testcases/lib/TestWorker.pm | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/testcases/lib/TestWorker.pm b/testcases/lib/TestWorker.pm index a224b718..140537d4 100644 --- a/testcases/lib/TestWorker.pm +++ b/testcases/lib/TestWorker.pm @@ -8,6 +8,8 @@ use IO::Handle; # for ->autoflush use POSIX (); +use Errno qw(EAGAIN); + use Exporter 'import'; our @EXPORT = qw(worker worker_next); @@ -74,7 +76,12 @@ sub worker_wait { my $ipc = $self->{ipc}; my $ipc_fd = fileno($ipc); - while (defined(my $file = $ipc->getline)) { + while (1) { + my $file = $ipc->getline; + if (!defined($file)) { + next if $! == EAGAIN; + last; + } chomp $file; exit unless $file; -- 2.39.5