Perl-Toolchain-Gang / Test-Harness

Run Perl standard test scripts with statistics
http://testanything.org/
29 stars 66 forks source link

fix eintr error handling in TAP::Parser::Multiplexer #104

Closed evengar2008 closed 3 years ago

evengar2008 commented 3 years ago

Fix periodic fails with forkprove running with tests list from STDIN and -j option set to > 1

We found out that forkprove (https://metacpan.org/release/forkprove) periodically randomly fails with the following error:

Can't use an undefined value as an ARRAY reference at /usr/share/perl/5.26/TAP/Parser/Multiplexer.pm line 138, <$reader> line 2.

We are using it like this:

forkprove -j 4 - < test_list.txt

The reason for this is that sometimes select system call is interrupted by $SIG{CHLD} handler (I don't know where it is located) and @ready array becomes an empty array. We are introducting a standard technique to handle this case in our PR: to retry select call if error was EINTR (Interrupted system call).

Leont commented 3 years ago

Yeah, I can see the problem with this code. The structure does seem a bit confusing though.