cpan-testers / CPAN-Reporter

(Perl) Adds CPAN Testers reporting to CPAN.pm
http://search.cpan.org/dist/CPAN-Reporter/
20 stars 18 forks source link

Detect failed open3 from Test::Harness #78

Open xdg opened 8 years ago

xdg commented 8 years ago

From a cpantesters-discuss mailing list thread:

Here's another odd failure:

http://www.cpantesters.org/cpan/report/cd9352da-4607-11e6-9fc5-14bfbd15da07

Output from '/usr/bin/make test':

PERL_DL_NONLAZY=1 "/home/njh/perl5/perlbrew/perls/perl-5.18.0/bin/perl" "-MExtUtils::Command::MM" "-MTest::Harness" "-e" "undef _Test::Harness::Switches; testharness(0, 'blib/lib', 'blib/arch')" t/.t Could not execute (/home/njh/perl5/perlbrew/perls/perl-5.18.0/bin/perl t/recurse.t): open3: exec of /home/njh/perl5/perlbrew/perls/perl-5.18.0/bin/perl t/recurse.t failed at /home/njh/perl5/perlbrew/perls/perl-5.18.0/lib/site_perl/5.18.0/TAP/Parser/Iterator/Process.pm line 165. Makefile:899: recipe for target 'test_dynamic' failed make: *\ [test_dynamic] Error 7

Unfortunately the 5.18.0 version of IPC::Open3 does not output the value of $! in case of an exec failure (see https://metacpan.org/source/RJBS/perl-5.18.0/ext/IPC-Open3/lib/IPC/Open3.pm#L277 ).

I've seen similar errors where the $! value was "Argument list too long". This usually happens if PERL5LIB is too long and exceeds the environment's maximum length. However, on current Unix systems this is typically more than 100kB, and PERL5LIB in the problematic report is far fom this limit.

If this is widespread/common/random, I wonder if CPAN::Reporter et al. need to try to detect this error and not send a report.

I do this (sort of) in my smoker wrapper: if a test report matches

m{Could not execute .* open3: exec of .* failed: Argument list too long at .*TAP/Parser/Iterator/Process.pm}

then it will not be sent to metabase.

Possibly the same approach could go into CPAN::Reporter, though without requiring "argument list too long" specifically. Any "open" failure in TAP::Parser::Iterator::Process is likely a failure unrelated to the distribution.