]> git.saurik.com Git - redis.git/blobdiff - tests/support/util.tcl
Don't abort test suite when the server block has a return value
[redis.git] / tests / support / util.tcl
index b9c89aa892021b939792eeefaed30e5cf3aff38f..95153111f2df263a125978cedfa08f1360e4d3ae 100644 (file)
@@ -140,12 +140,19 @@ proc findKeyWithType {r type} {
     return {}
 }
 
-proc createComplexDataset {r ops} {
+proc createComplexDataset {r ops {opt {}}} {
     for {set j 0} {$j < $ops} {incr j} {
         set k [randomKey]
         set k2 [randomKey]
         set f [randomValue]
         set v [randomValue]
+
+        if {[lsearch -exact $opt useexpire] != -1} {
+            if {rand() < 0.1} {
+                {*}$r expire [randomKey] [randomInt 2]
+            }
+        }
+
         randpath {
             set d [expr {rand()}]
         } {