Subject: | Race condition when running tests in parallel |
There are some fail reports on CPAN Testers (see http://matrix.cpantesters.org/?dist=mocked%200.09 for an overview) and it seems that some (all?) are caused by race conditions, maybe if the test suite is run in parallel.
I can reproduce it if calling "prove -b -j2 t/" a couple of times. For example:
Subroutine module_filename redefined at lib/Foo/PreLoaded.pm line 10.
===( 1;0 1/? 0/? )==============================================Can't locate Foo/UsingUnmocked.pm in @INC (you may need to install the Foo::UsingUnmocked module) (@INC contains: t/lib) at (eval 6) line 2.
BEGIN failed--compilation aborted at t/unmocked.t line 10.
# Looks like your test exited with 2 before it could output anything.
t/unmocked.t .. Dubious, test returned 2 (wstat 512, 0x200)
No subtests run
t/mocked.t .... 13/? cannot unlink file for t/ERK/Foo/Baz.pm: No such file or directory at t/TestUtils.pm line 150.
cannot restore permissions to 0100664 for t/ERK/Foo/Baz.pm: No such file or directory at t/TestUtils.pm line 150.
t/mocked.t .... ok