Subject: | random failure under HARNESS_OPTIONS=j2 |
This failure occurs roughly one in 100 times when you're running as simply:
> for i in $(seq 0 100); do prove -j100 -lvr t/*; done
However, I was having it fail _every time_ when trying to install/test via cpanm.
My suspicion is that 02 creates the statefile between the 2 passes of 01's traversal, invalidating the test result, or something like that. Its quirky.
The only thing I can see for sure, is that by customising t/02.t to point the statefile into /tmp/ instead of inside . , then it seems impossible to make the tests fail.
PERL_DL_NONLAZY=1 /home/kent/perl5/perlbrew/perls/perl-5.19.6/bin/perl5.19.6 "-MExtUtils::Command::MM" "-MTest::Harness" "-e" "undef *Test::Harness::Switches; test_harness(0, 'blib/lib', 'blib/arch')" t/*.t
===( 2;0 1/7 1/2 )==============================================
# Failed test at t/01.t line 24.
# Looks like you failed 1 test of 7.
t/01.t .. Dubious, test returned 1 (wstat 256, 0x100)
Failed 1/7 subtests
t/02.t .. ok
Test Summary Report
-------------------
t/01.t (Wstat: 256 Tests: 7 Failed: 1)
Failed test: 3
Non-zero exit status: 1
Files=2, Tests=9, 0 wallclock secs ( 0.03 usr 0.00 sys + 0.09 cusr 0.02 csys = 0.14 CPU)
Result: FAIL
Failed 1/2 test programs. 1/9 subtests failed.
I changed the 3rd test in 01.t to read
if( not ok @res == @res2 ) {
diag explain {
res => \@res,
res2 => \@res2,
};
}
And indeed, it shows the difference is the "statefile" produced by 02.t