[Jifty-commit] r664 -

jifty-commit at lists.jifty.org jifty-commit at lists.jifty.org
Sun Mar 5 03:41:15 EST 2006


Author: jesse
Date: Sun Mar  5 03:41:14 2006
New Revision: 664

Modified:
   /   (props changed)
   jifty/trunk/lib/Jifty/Test.pm

Log:
 r25581 at truegrounds:  jesse | 2006-03-04 22:50:28 -0800
 * each test script gets its own memcached namespace


Modified: jifty/trunk/lib/Jifty/Test.pm
==============================================================================
--- jifty/trunk/lib/Jifty/Test.pm	(original)
+++ jifty/trunk/lib/Jifty/Test.pm	Sun Mar  5 03:41:14 2006
@@ -40,7 +40,18 @@
         my $self = shift;
         $self->stash(Hash::Merge::merge($self->stash, $class->test_config($self)));
     };
-
+    {
+        # Cache::Memcached stores things. And doesn't let them
+        # expire from the cache easily. This is fine in production,
+        # but during testing each test script needs its own namespace.
+        # we use the pid.
+
+        no warnings qw/redefine/;
+    
+        sub Jifty::Record::cache_key_prefix {
+            'jifty-test-' . $$;
+        }
+    }
     my $root = Jifty::Util->app_root;
     unshift @INC, "$root/lib" if ($root);
 


More information about the Jifty-commit mailing list