Subject: | Time races in tests |
Many tests, like t/04-interval.t relies on precise timing that cannot be guaranteed. E.g. I encountered this failure on an overloaded machine:
t/03-spareworkers.t ...................... ok
# Failed test 'workers at 6 sec'
# at t/04-interval.t line 30.
# got: '0'
# expected: '1'
# Looks like you failed 1 test of 6.
t/04-interval.t ..........................
Dubious, test returned 1 (wstat 256, 0x100)
Failed 1/6 subtests
The reason is a CPU scheduler may delay process execution more then the various "sleep" calls specify and then the test will fail.
CPAN test matrix <http://matrix.cpantesters.org/?dist=Parallel-Prefork+0.18> displays many failures in other tests.
Can the tests be improved to eliminate the inherent races?