]> git.saurik.com Git - redis.git/blob - tests/integration/replication-2.tcl
Properly wait the slave to sync with master in BRPOPLPUSH test.
[redis.git] / tests / integration / replication-2.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 dataset should be identical after complex ops} {
10 createComplexDataset r 10000
11 after 500
12 if {[r debug digest] ne [r -1 debug digest]} {
13 set csv1 [csvdump r]
14 set csv2 [csvdump {r -1}]
15 set fd [open /tmp/repldump1.txt w]
16 puts -nonewline $fd $csv1
17 close $fd
18 set fd [open /tmp/repldump2.txt w]
19 puts -nonewline $fd $csv2
20 close $fd
21 puts "Master - Slave inconsistency"
22 puts "Run diff -u against /tmp/repldump*.txt for more info"
23 }
24 assert_equal [r debug digest] [r -1 debug digest]
25 }
26 }
27 }