From: Nicholas Clark Date: Mon, 25 Jan 2010 10:27:38 +0000 (+0000) Subject: Change from a hard coded temporary file name in lib/AnyDBM_File.t. X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=bdbb64c22f35e0b11cf29ddb2597039baf475c01;p=p5sagit%2Fp5-mst-13.2.git Change from a hard coded temporary file name in lib/AnyDBM_File.t. Previously lib/AnyDBM_File.t and lib/DBM_Filter/t/*t shared the same hard coded filename for their test database, causing a race condition during parallel testing, and some spurious test failures. --- diff --git a/lib/AnyDBM_File.t b/lib/AnyDBM_File.t index cb9eee9..43405b9 100644 --- a/lib/AnyDBM_File.t +++ b/lib/AnyDBM_File.t @@ -17,15 +17,16 @@ $Is_Dosish = ($^O eq 'amigaos' || $^O eq 'MSWin32' || $^O eq 'os2' || $^O eq 'mint' || $^O eq 'cygwin'); -unlink ; +my $filename = "Any_dbmx$$"; +unlink <"$filename*">; umask(0); -ok( tie(%h,AnyDBM_File,'Op_dbmx', O_RDWR|O_CREAT, 0640), "Tie"); +ok( tie(%h,AnyDBM_File,"$filename", O_RDWR|O_CREAT, 0640), "Tie"); -$Dfile = "Op_dbmx.pag"; +$Dfile = "$filename.pag"; if (! -e $Dfile) { - ($Dfile) = ; + ($Dfile) = <$filename*>; } SKIP: @@ -63,7 +64,7 @@ $h{'goner2'} = 'snork'; delete $h{'goner2'}; untie(%h); -ok(tie(%h,AnyDBM_File,'Op_dbmx', O_RDWR, 0640),"Re-tie hash"); +ok(tie(%h,AnyDBM_File,"$filename", O_RDWR, 0640),"Re-tie hash"); $h{'j'} = 'J'; $h{'k'} = 'K'; @@ -151,7 +152,7 @@ SKIP: untie %h; if ($^O eq 'VMS') { - unlink 'Op_dbmx.sdbm_dir', $Dfile; + unlink "$filename.sdbm_dir", $Dfile; } else { - unlink 'Op_dbmx.dir', $Dfile; + unlink "$filename.dir", $Dfile; }