[Rt-commit] rt branch, 4.0/helpers-http-cache-headers, updated. rt-4.0.8-309-g9d465e0

Thomas Sibley trs at bestpractical.com
Wed Apr 3 12:29:23 EDT 2013


The branch, 4.0/helpers-http-cache-headers has been updated
       via  9d465e09feb8f9ebfd24869bc3172e48873b5db2 (commit)
      from  8207035eae9e30697508662cde9f6d88452c9267 (commit)

Summary of changes:
 t/web/helpers-http-cache-headers.t | 13 ++++++++++---
 1 file changed, 10 insertions(+), 3 deletions(-)

- Log -----------------------------------------------------------------
commit 9d465e09feb8f9ebfd24869bc3172e48873b5db2
Author: Thomas Sibley <trs at bestpractical.com>
Date:   Wed Apr 3 09:27:15 2013 -0700

    Use the same fixed time in tests for the web server and test file
    
    While the simple usage is enough for test servers which fork later or
    live in the same process, we need to ensure an externally spawned server
    (such as apache) also picks up the same fixed point in time.

diff --git a/t/web/helpers-http-cache-headers.t b/t/web/helpers-http-cache-headers.t
index 67ccde0..74ca7b9 100644
--- a/t/web/helpers-http-cache-headers.t
+++ b/t/web/helpers-http-cache-headers.t
@@ -6,10 +6,17 @@ use utf8;
 #      endpoints checking for the right headers.
 
 use File::Find;
-use Test::MockTime 'set_fixed_time';
-set_fixed_time(time());
 
-use RT::Test tests => undef;
+BEGIN {
+    # Ensure that the test and server processes use the same fixed time.
+    use constant TIME => time();
+    use Test::MockTime 'set_fixed_time';
+    set_fixed_time(TIME);
+
+    use RT::Test
+        tests   => undef,
+        config  => "use Test::MockTime 'set_fixed_time'; set_fixed_time(".TIME.");";
+}
 
 my ($base, $m) = RT::Test->started_ok;
 ok $m->login, 'logged in';

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


More information about the Rt-commit mailing list