New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Test dist/Storable/t/blessed.t fails with threaded perls < 5.14 under not too old Test2 #16395
Comments
From @andkThree little birdies twittered the story to me, I lend them my voice This is not about a bug in Storable. It's about a bug in old threaded The bug in perl itself was fixed in v5.19.2-116-g82b84d0. Test::More 1.001014 did not trigger the bug, it was only exposed But Test2 developed a workaround for the bug. Unfortunately that T2_CHECK_DEPTH=1 make test in order to pass all Storable tests. There is a contrived workaround for blessed.t itself. It avoids % diff -U1 t/blessed.t{~,} Inline Patch--- t/blessed.t~ 2018-01-30 20:44:59.935027614 +0000
+++ t/blessed.t 2018-01-30 20:51:01.133495863 +0000
@@ -18,4 +18,2 @@
-use Test::More;
-
use Storable qw(freeze thaw store retrieve);
@@ -28,2 +26,4 @@
+use Test::More;
+
{
-- |
From @jkeenanOn Wed, 31 Jan 2018 04:20:26 GMT, andreas.koenig.7os6VVqR@franz.ak.mind.de wrote:
I'm having trouble following you and, consequently, don't know how to reproduce the bug or test for its elimination once a correction has been made. Are you saying that that if one combines a 7-year-old Perl with a contemporary Test-Simple distribution, you get a failure in a test for Storable in blead? Thank you very much. -- |
The RT System itself - Status changed from 'new' to 'open' |
From @andk
> On Wed, 31 Jan 2018 04:20:26 GMT, andreas.koenig.7os6VVqR@franz.ak.mind.de wrote:
> I'm having trouble following you and, consequently, don't know how to Sorry, I'm not sure which information I left out. Maybe the fact that I'm pretty sure, no offense would be taken when you would not test the > Are you saying that that if one combines a 7-year-old Perl with a Yes. perl 5.12.5 was released 2012-Nov-10, so is now 5 1/4 years old. Many Recipe once again: take old perl, e.g. 5.12.5, compile it with threads, Adding an example: take random pick from the matrix > Thank you very much. Thank you, I hope this clarifies what this is about, |
From @jkeenanOn Wed, 31 Jan 2018 17:12:57 GMT, andreas.koenig.7os6VVqR@franz.ak.mind.de wrote:
Please smoke branch smoke-me/jkeenan/132790-storable-blessed-t. Since, as noted in the commit message, I don't know why this fix "works", we'll need further discussion and a better commit message before merging to blead. -- |
From @jkeenan0001-TODO-Add-explanation-as-to-why-this-patch-works.patchFrom 17e66fadd7c4d573e1b4cf6e1df5a4e5a4fc60c7 Mon Sep 17 00:00:00 2001
From: James E Keenan <jkeenan@cpan.org>
Date: Wed, 31 Jan 2018 13:25:22 -0500
Subject: [PATCH] TODO: Add explanation as to why this patch "works".
In RT #132790, Andreas reported that 3 unit tests in t/blessed.t were failing
under these conditions:
* pre-perl-5.14 perl
* modern Test-Simple distribution
* modern Storable from CPAN (which is behind blead)
For some reason TK moving the import of Test::More below %::weird_refs clears up
the test failures. This appears to have no impact on blead.
The benefit of this will, of course, only become evident when a new version of
Storable is released to CPAN.
---
dist/Storable/t/blessed.t | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/dist/Storable/t/blessed.t b/dist/Storable/t/blessed.t
index 352eb5f..667746a 100644
--- a/dist/Storable/t/blessed.t
+++ b/dist/Storable/t/blessed.t
@@ -26,25 +26,25 @@ sub BEGIN {
if ($ENV{PERL_CORE} and $Config{'extensions'} !~ /\bStorable\b/) {
print "1..0 # Skip: Storable was not built\n";
exit 0;
}
}
-use Test::More;
-
use Storable qw(freeze thaw store retrieve);
{
%::weird_refs = (
REF => \(my $aref = []),
VSTRING => \(my $vstring = v1.2.3),
'long VSTRING' => \(my $vstring = eval "v" . 0 x 300),
LVALUE => \(my $substr = substr((my $str = "foo"), 0, 3)),
);
}
+use Test::More;
+
my $test = 12;
my $tests = $test + 23 + (2 * 6 * keys %::immortals) + (3 * keys %::weird_refs);
plan(tests => $tests);
package SHORT_NAME;
--
2.7.4
|
Migrated from rt.perl.org#132790 (status was 'open')
Searchable as RT132790$
The text was updated successfully, but these errors were encountered: