]> git.saurik.com Git - redis.git/blob - tests/integration/replication-3.tcl
80140f20d18d878b8fb0d20f4c14d6dd12d67945
[redis.git] / tests / integration / replication-3.tcl
1 start_server {tags {"repl"}} {
2 start_server {} {
3 test {First server should have role slave after SLAVEOF} {
4 r -1 slaveof [srv 0 host] [srv 0 port]
5 after 1000
6 s -1 role
7 } {slave}
8
9 test {MASTER and SLAVE consistency with expire} {
10 createComplexDataset r 50000 useexpire
11 after 4000 ;# Make sure everything expired before taking the digest
12 r keys * ;# Force DEL syntesizing to slave
13 after 1000 ;# Wait another second. Now everything should be fine.
14 if {[r debug digest] ne [r -1 debug digest]} {
15 set csv1 [csvdump r]
16 set csv2 [csvdump {r -1}]
17 set fd [open /tmp/repldump1.txt w]
18 puts -nonewline $fd $csv1
19 close $fd
20 set fd [open /tmp/repldump2.txt w]
21 puts -nonewline $fd $csv2
22 close $fd
23 puts "Master - Slave inconsistency"
24 puts "Run diff -u against /tmp/repldump*.txt for more info"
25 }
26 assert_equal [r debug digest] [r -1 debug digest]
27 }
28 }
29 }