]> git.saurik.com Git - redis.git/commitdiff
false positive in expire tests mitigated with a sleep, but other solutions exist...
authorantirez <antirez@gmail.com>
Thu, 26 Jan 2012 15:45:08 +0000 (16:45 +0100)
committerantirez <antirez@gmail.com>
Thu, 26 Jan 2012 15:45:08 +0000 (16:45 +0100)
tests/unit/other.tcl

index 6bdb0b3f96fcd727c2fa0700e35914d5d9120ba1..14fd73ac7886c08e7e753800ece0016a7510ecdc 100644 (file)
@@ -141,6 +141,11 @@ start_server {tags {"other"}} {
 
         # Reload and check
         waitForBgrewriteaof r
+        # We need to wait two seconds to avoid false positives here, otherwise
+        # the DEBUG LOADAOF command may read a partial file.
+        # Another solution would be to set the fsync policy to no, since this
+        # prevents write() to be delayed by the completion of fsync().
+        after 2000
         r debug loadaof
         set ttl [r ttl x]
         assert {$ttl > 900 && $ttl <= 1000}