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.
This commit is contained in:
parent
d92626bc62
commit
ae88accf6f
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user