X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2F04thread-torture.t;h=8f09b3a83f9e6adfd33e92f809707160fe4b914e;hb=c1ec81b529918670b355c2e13be49b361d169dd4;hp=2424aaebf41f7af95fe96cea76f254d51352dcfe;hpb=24538b0888de38ff5417c0c5dcf5679905d40fb7;p=p5sagit%2FDevel-PeekPoke.git diff --git a/t/04thread-torture.t b/t/04thread-torture.t index 2424aae..8f09b3a 100644 --- a/t/04thread-torture.t +++ b/t/04thread-torture.t @@ -19,8 +19,16 @@ $|++; # seems to be critical share $::TEST_COUNT; # older perls crash if threads are spawned way too quickly, sleep for 100 msecs -my @pool = map { sleep 0.1 and threads->create(\&run_torture) } (1..10); -$_->join for @pool; +my @pool = map { sleep 0.1 and threads->create(\&run_torture) } (1..($ENV{AUTOMATED_TESTING} ? 20 : 5) ); + +# again - necessary for older perls +sleep 1; + +for (@pool) { + if ($_->join != 42) { + die ($_->can('error') ? $_->error : "Thread did not finish successfully" ); + } +} if ($ENV{AUTOMATED_TESTING}) { my $vsz; @@ -37,7 +45,7 @@ if ($ENV{AUTOMATED_TESTING}) { print "1..$::TEST_COUNT\n"; sub run_torture { - my $src = do { local (@ARGV, $/) = 't/03torture.t'; <>; }; - eval $src; + do 't/03torture.t'; die $@ if $@ ne ''; + 42; }