From: Peter Rabbitson Date: Fri, 3 Oct 2014 19:24:28 +0000 (+0200) Subject: Do not tickle defective 5.10.0 threads in tests X-Git-Tag: v0.10012~1 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=270b8b0ff6a3a40932caa937459e884904d9dd49;p=p5sagit%2FClass-Accessor-Grouped.git Do not tickle defective 5.10.0 threads in tests --- diff --git a/Changes b/Changes index 9f727f2..90aa1f4 100644 --- a/Changes +++ b/Changes @@ -1,5 +1,7 @@ Revision history for Class::Accessor::Grouped. + - Fix tests tickling deficient threads on perl 5.10.0 + 0.10011 2014-09-26 11:24 (UTC) - Soft-depend on newer (bugfixed and *simpler*) Class::XSAccessor 1.19 - More robust threading tests diff --git a/t/accessors_pp.t b/t/accessors_pp.t index 8f20812..d97e3fa 100644 --- a/t/accessors_pp.t +++ b/t/accessors_pp.t @@ -64,16 +64,28 @@ for my $tname (qw/accessors.t accessors_ro.t accessors_wo.t/) { for (1,2) { is ( threads->create(sub { - is ( - threads->create(sub { - $todo->(); - })->join, - 666, - 'Innner thread joined ok', - ); - 777; + + # nested threading of this sort badly blows up on 5.10.0 (fixed with 5.10.1) + unless ($] > 5.009 and $] < 5.010001) { + is ( + + threads->create(sub { + $todo->(); + })->join, + + 666, + + 'Innner thread joined ok', + ); + + is ($todo->(), 666, "Intermediate result ok"); + } + + return 777; })->join, + 777, + 'Outer thread joined ok', ); diff --git a/t/accessors_xs.t b/t/accessors_xs.t index 63bce81..814f8b5 100644 --- a/t/accessors_xs.t +++ b/t/accessors_xs.t @@ -66,16 +66,28 @@ for my $tname (qw/accessors.t accessors_ro.t accessors_wo.t/) { for (1,2) { is ( threads->create(sub { - is ( - threads->create(sub { - $todo->(); - })->join, - 666, - 'Innner thread joined ok', - ); - 777; + + # nested threading of this sort badly blows up on 5.10.0 (fixed with 5.10.1) + unless ($] > 5.009 and $] < 5.010001) { + is ( + + threads->create(sub { + $todo->(); + })->join, + + 666, + + 'Innner thread joined ok', + ); + + is ($todo->(), 666, "Intermediate result ok"); + } + + return 777; })->join, + 777, + 'Outer thread joined ok', );