[Rt-commit] rt branch, 4.0/test-tempdirs, updated. rt-4.0.0-390-g4c1ff6f

Thomas Sibley trs at bestpractical.com
Fri May 20 14:57:19 EDT 2011


The branch, 4.0/test-tempdirs has been updated
       via  4c1ff6fd63416cec3853d2e82d6f105afe803b9b (commit)
      from  ebe34f8cfd694a4655b012a86f2ac44bd2a2698e (commit)

Summary of changes:
 lib/RT/Test.pm |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

- Log -----------------------------------------------------------------
commit 4c1ff6fd63416cec3853d2e82d6f105afe803b9b
Author: Thomas Sibley <trs at bestpractical.com>
Date:   Fri May 20 14:56:24 2011 -0400

    Create a flat set of test temp directories instead of a hierarchy
    
    This means that we avoid having to cleanup nested directories, which
    gets really hairy due to race conditions.

diff --git a/lib/RT/Test.pm b/lib/RT/Test.pm
index 196f238..e36188c 100644
--- a/lib/RT/Test.pm
+++ b/lib/RT/Test.pm
@@ -215,11 +215,13 @@ sub bootstrap_tempdir {
     if (File::Spec->rel2abs((caller(1))[1]) =~ m{(?:^|[\\/])(x?t)[/\\](.*)}) {
         $test_dir  = $1;
         $test_file = $2;
+        $test_file =~ s{[/\\]}{-}g;
     }
 
-    my $dir_name = File::Spec->rel2abs("$test_dir/tmp/$test_file");
+    my $dir_name = File::Spec->rel2abs("$test_dir/tmp");
     mkpath( $dir_name );
     return $tmp{'directory'} = File::Temp->newdir(
+        "$test_file-XXXXXXXX",
         DIR => $dir_name
     );
 }

-----------------------------------------------------------------------


More information about the Rt-commit mailing list