X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2F51threadtxn.t;h=6c781e5629aca2bcfad5df4aca4ed9d582cf08f1;hb=09d2e66a5d5558ef9a19dc2ec510d5dafd2fb7d8;hp=52a6966e2107cf115fa6ebf8e69dba72ff1a9f4f;hpb=10dd5c05fee5be6ff4d72e41ab0d7b51809fdb5a;p=dbsrgits%2FDBIx-Class.git diff --git a/t/51threadtxn.t b/t/51threadtxn.t index 52a6966..6c781e5 100644 --- a/t/51threadtxn.t +++ b/t/51threadtxn.t @@ -29,6 +29,7 @@ plan skip_all => 'DBIC does not actively support threads before perl 5.8.5' use Scalar::Util 'weaken'; use Time::HiRes qw(time sleep); +use List::Util 'max'; use DBICTest; @@ -70,7 +71,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;