X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2F51threads.t;h=d5cd0d5bc9c063ba8e7e6bf7b703ba3e364be51c;hb=86be9bcb90213db633791fcce074b7268765f615;hp=be0b1d670a3ba418044edda43d99cce682d295b1;hpb=10dd5c05fee5be6ff4d72e41ab0d7b51809fdb5a;p=dbsrgits%2FDBIx-Class.git diff --git a/t/51threads.t b/t/51threads.t index be0b1d6..d5cd0d5 100644 --- a/t/51threads.t +++ b/t/51threads.t @@ -22,6 +22,7 @@ use warnings; use Test::More; use Test::Exception; use Time::HiRes qw(time sleep); +use List::Util 'max'; plan skip_all => 'DBIC does not actively support threads before perl 5.8.5' if "$]" < 5.008005; @@ -115,7 +116,7 @@ while(@children < $num_children) { my $newthread = async { my $tid = threads->tid; - sleep ($t - time); + sleep( max( 0.1, $t - time ) ); # FIXME if we do not stagger the threads, sparks fly due to CXSA sleep ( $tid / 10 ) if "$]" < 5.012;