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
Storable's tests do not run safely in parallel #14946
Comments
From @karenetheridgeI encountered this failure when installing Storable-2.51 (listed as Tests should be able to be run safely in parallel, by using File::Temp or some --> Working on Storable Test Summary Report |
From @eserteDana Pon 28. Ruj 2015, 11:42:27, ether reče:
Attached patch is not complete (I think both store.t and forgive.t also use "store" as a common file, maybe others, too). But at least it should fix my "sin". Regards, |
From @eserte0001-Use-File-Temp-in-code.t.patchFrom c1e1036bc567ab606b7be622d5564a585a0bdb34 Mon Sep 17 00:00:00 2001
From: Slaven Rezic <slaven@rezic.de>
Date: Mon, 28 Sep 2015 21:11:09 +0200
Subject: [PATCH] Use File::Temp in code.t
This (partially) addresses RT#126213.
---
dist/Storable/t/code.t | 47 +++++++++++++++++++++++++++++++----------------
1 file changed, 31 insertions(+), 16 deletions(-)
diff --git a/dist/Storable/t/code.t b/dist/Storable/t/code.t
index 7fc40ba..bbe7756 100644
--- a/dist/Storable/t/code.t
+++ b/dist/Storable/t/code.t
@@ -1,6 +1,6 @@
#!./perl
#
-# Copyright (c) 2002 Slaven Rezic
+# Copyright (c) 2002,2015 Slaven Rezic
#
# You may redistribute only under the same terms as Perl 5, as specified
# in the README file that comes with the distribution.
@@ -77,6 +77,8 @@ local *FOO;
$Storable::Deparse = 1;
$Storable::Eval = 1;
+my $File_Temp_available = eval { require File::Temp; File::Temp->VERSION(0.14) }; # 0.14 introduced OO interface
+
######################################################################
# Test freeze & thaw
@@ -125,26 +127,39 @@ is($new_sub->(), $obj[2]->());
######################################################################
# Test retrieve & store
-store $obj[0], 'store';
-$thawed = retrieve 'store';
+SKIP: {
+ skip "File::Temp is not available", 5
+ if !$File_Temp_available;
-is($thawed->[0]->(), "JAPH");
-is($thawed->[1]->(), 42);
-is($thawed->[2]->(), "blessed");
-is($thawed->[3]->(), "Another::Package");
-is(prototype($thawed->[4]), prototype($obj[0]->[4]));
+ my $temp = File::Temp->new;
+ store $obj[0], $temp;
+ $thawed = retrieve $temp;
+ unlink $temp;
+
+ is($thawed->[0]->(), "JAPH");
+ is($thawed->[1]->(), 42);
+ is($thawed->[2]->(), "blessed");
+ is($thawed->[3]->(), "Another::Package");
+ is(prototype($thawed->[4]), prototype($obj[0]->[4]));
+}
######################################################################
-nstore $obj[0], 'store';
-$thawed = retrieve 'store';
-unlink 'store';
+SKIP: {
+ skip "File::Temp is not available", 5
+ if !$File_Temp_available;
-is($thawed->[0]->(), "JAPH");
-is($thawed->[1]->(), 42);
-is($thawed->[2]->(), "blessed");
-is($thawed->[3]->(), "Another::Package");
-is(prototype($thawed->[4]), prototype($obj[0]->[4]));
+ my $temp = File::Temp->new;
+ nstore $obj[0], $temp;
+ $thawed = retrieve $temp;
+ unlink $temp;
+
+ is($thawed->[0]->(), "JAPH");
+ is($thawed->[1]->(), 42);
+ is($thawed->[2]->(), "blessed");
+ is($thawed->[3]->(), "Another::Package");
+ is(prototype($thawed->[4]), prototype($obj[0]->[4]));
+}
######################################################################
# Security with
--
2.1.2
|
The RT System itself - Status changed from 'new' to 'open' |
From @jkeenanOn Mon Sep 28 11:42:27 2015, ether wrote:
Here's a grep that may be helpful: $ grep -nE "'(fetch|store)'" dist/Storable/t/*.t -- |
From @bulk88On Mon Sep 28 12:15:23 2015, slaven@rezic.de wrote:
That looks flakey. What if an exception is thrown inside the "+my $File_Temp_available = eval { require File::Temp; File::Temp->VERSION(0.14) }; # 0.14 introduced OO interface"? What about old File::Temps, then skip the tests? Why not just delete the tests entirely since that is silently being done on some old configs? Perhaps appending the current PID is more reliable across all perls, old and new. -- |
From @ilmari"bulk88 via RT" <perlbug-followup@perl.org> writes:
Data point: File::Temp 0.14 was shipped with perl 5.6.2.
You're saying because a test won't be run on a version of perl released Is anyone still using perls older than that? Are they likely to be [1] http://matrix.cpantesters.org/?dist=Storable;maxver=1 -- |
From @bulk88On Tue Sep 29 01:12:13 2015, ilmari wrote:
Then properly drop support for that old perl (<5.6.2 or <0.14), with a hard error. Not a silent false positive (skipping tests). -- |
From @eserte"bulk88 via RT" <perlbug-followup@perl.org> writes:
Storable is a dual-life module and apparently has no minimum perl If it's possible to detect that this test run happens within a perl $File_Temp_available = $ENV{PERL_CORE} || eval { require File::Temp; File::Temp->VERSION(0.14) } Regards, -- Berlin Perl Mongers - http://berlin.pm.org |
From @tonycozOn Mon, 28 Sep 2015 11:42:27 -0700, ether wrote:
I believe this is no longer a problem. All tests either use a name with the pid included or a name specific to that test files (since perl 5.28/Storable 3.06). Tony |
Migrated from rt.perl.org#126213 (status was 'open')
Searchable as RT126213$
The text was updated successfully, but these errors were encountered: