From: Vincent Pit Date: Mon, 3 Aug 2015 17:04:59 +0000 (-0300) Subject: Harden t/59-yield-threads.t against stray exits X-Git-Tag: v0.28~11 X-Git-Url: http://git.vpit.fr/?a=commitdiff_plain;h=d5bd1454cae95ffddd93e685e3c81b893046fcdb;p=perl%2Fmodules%2FScope-Upper.git Harden t/59-yield-threads.t against stray exits --- diff --git a/t/59-yield-threads.t b/t/59-yield-threads.t index 736388e..26baf50 100644 --- a/t/59-yield-threads.t +++ b/t/59-yield-threads.t @@ -38,12 +38,17 @@ sub up1 { ); is_deeply \@res, [ -1, $tid .. $tid + 2, -2 ], "$p: yielded correctly"; + + return 1; } my @threads = map spawn(\&up1), 1 .. 30; -$_->join for @threads; +my $completed = 0; +for my $thr (@threads) { + ++$completed if $thr->join; +} pass 'done'; -done_testing(scalar(@threads) + 1); +done_testing($completed + 1);