From: Vincent Pit Date: Mon, 3 Aug 2015 17:03:36 +0000 (-0300) Subject: Harden t/54-unwind-threads.t against stray exits X-Git-Tag: v0.28~12 X-Git-Url: http://git.vpit.fr/?a=commitdiff_plain;h=57746d0b3de44a1205902e433488c8a1afe69469;p=perl%2Fmodules%2FScope-Upper.git Harden t/54-unwind-threads.t against stray exits --- diff --git a/t/54-unwind-threads.t b/t/54-unwind-threads.t index af6a3ca..490e6ad 100644 --- a/t/54-unwind-threads.t +++ b/t/54-unwind-threads.t @@ -38,12 +38,17 @@ sub up1 { ); is_deeply \@res, [ -1, $tid .. $tid + 2, -2 ], "$p: unwinded 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);