[otrs-cvs] otrs/scripts/test Cache.t,1.23.2.1,1.23.2.2

"CVS commits notifications of OTRS.org" <[email protected]>
Newsgroups gmane.comp.otrs.cvs
Message-ID <[email protected]>
Comments:
Update of /home/cvs/otrs/scripts/test
In directory lancelot:/tmp/cvs-serv30786

Modified Files:
      Tag: rel-3_1
	Cache.t 
Log Message:
Improved stability of TTL tests.

Author: mh

Index: Cache.t
===================================================================
RCS file: /home/cvs/otrs/scripts/test/Cache.t,v
retrieving revision 1.23.2.1
retrieving revision 1.23.2.2
diff -2 -u -d -r1.23.2.1 -r1.23.2.2
--- Cache.t	14 Nov 2012 22:42:33 -0000	1.23.2.1
+++ Cache.t	28 Nov 2012 11:04:49 -0000	1.23.2.2
@@ -173,4 +173,6 @@
     );
 
+    my $TTLTimeStart = $Self->{TimeObject}->SystemTime();
+
     $CacheSet = $CacheObject->Set(
         Type  => 'CacheTest2',
@@ -182,5 +184,5 @@
     $Self->True(
         $CacheSet,
-        "#4 - $Module - CacheSet(), TTL 2",
+        "#4 - $Module - CacheSet(), TTL 4",
     );
 
@@ -190,15 +192,21 @@
     );
 
-    $Self->Is(
-        $CacheGet || '',
-        '9ßüß-カスタ1234',
-        "#4 - $Module - CacheGet()",
-    );
-    $Self->True(
-        Encode::is_utf8($CacheGet) || '',
-        "#4 - $Module - CacheGet() - Encode::is_utf8",
-    );
+    my $TTLTimeStop = $Self->{TimeObject}->SystemTime();
+    my $TTLTimeDiff = $TTLTimeStop - $TTLTimeStart;
 
-    sleep 5;
+    if ( $TTLTimeDiff <= 4 ) {
+
+        $Self->Is(
+            $CacheGet || '',
+            '9ßüß-カスタ1234',
+            "#4 - $Module - CacheGet()",
+        );
+        $Self->True(
+            Encode::is_utf8($CacheGet) || '',
+            "#4 - $Module - CacheGet() - Encode::is_utf8",
+        );
+    }
+
+    sleep( 6 - $TTLTimeDiff );
 
     $CacheGet = $CacheObject->Get(
@@ -209,5 +217,5 @@
     $Self->True(
         !$CacheGet || '',
-        "#4 - $Module - CacheGet() - sleep4 - TTL of 2 expired",
+        "#4 - $Module - CacheGet() - sleep 6 - TTL of 4 expired",
     );

---------------------------------------------------------------------
OTRS mailing list: cvs-log - Webpage: http://otrs.org/
Archive: http://lists.otrs.org/pipermail/cvs-log
To unsubscribe: http://lists.otrs.org/cgi-bin/listinfo/cvs-log
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.