]> git.saurik.com Git - redis.git/blobdiff - tests/integration/replication.tcl
Merge master with resolved conflict in src/redis-cli.c
[redis.git] / tests / integration / replication.tcl
index 39d77c8f9c07e90d8bf3261325ab7955e5c142ef..6ca5a6dda894050228632f6e78eb7a8796ed1185 100644 (file)
@@ -8,6 +8,37 @@ start_server {tags {"repl"}} {
 
         test {MASTER and SLAVE dataset should be identical after complex ops} {
             createComplexDataset r 10000
+            after 500
+            if {[r debug digest] ne [r -1 debug digest]} {
+                set csv1 [csvdump r]
+                set csv2 [csvdump {r -1}]
+                set fd [open /tmp/repldump1.txt w]
+                puts -nonewline $fd $csv1
+                close $fd
+                set fd [open /tmp/repldump2.txt w]
+                puts -nonewline $fd $csv2
+                close $fd
+                puts "Master - Slave inconsistency"
+                puts "Run diff -u against /tmp/repldump*.txt for more info"
+            }
+            assert_equal [r debug digest] [r -1 debug digest]
+        }
+
+        test {MASTER and SLAVE consistency with expire} {
+            createComplexDataset r 50000 useexpire
+            after 4000 ;# Make sure everything expired before taking the digest
+            if {[r debug digest] ne [r -1 debug digest]} {
+                set csv1 [csvdump r]
+                set csv2 [csvdump {r -1}]
+                set fd [open /tmp/repldump1.txt w]
+                puts -nonewline $fd $csv1
+                close $fd
+                set fd [open /tmp/repldump2.txt w]
+                puts -nonewline $fd $csv2
+                close $fd
+                puts "Master - Slave inconsistency"
+                puts "Run diff -u against /tmp/repldump*.txt for more info"
+            }
             assert_equal [r debug digest] [r -1 debug digest]
         }
     }