X-Git-Url: https://git.saurik.com/redis.git/blobdiff_plain/a7159fe817b163d17ff64fae0d459bbe786280ef..db6a2e7f78f99503eaa2fcc0574a16eea570637a:/tests/integration/replication.tcl diff --git a/tests/integration/replication.tcl b/tests/integration/replication.tcl index 0f5d496d..49408ac0 100644 --- a/tests/integration/replication.tcl +++ b/tests/integration/replication.tcl @@ -1,3 +1,31 @@ +start_server {tags {"repl"}} { + start_server {} { + test {First server should have role slave after SLAVEOF} { + r -1 slaveof [srv 0 host] [srv 0 port] + after 1000 + s -1 role + } {slave} + + test {BRPOPLPUSH replication, when blocking against empty list} { + set rd [redis_deferring_client] + $rd brpoplpush a b 5 + r lpush a foo + after 1000 + assert_equal [r debug digest] [r -1 debug digest] + } + + test {BRPOPLPUSH replication, list exists} { + set rd [redis_deferring_client] + r lpush c 1 + r lpush c 2 + r lpush c 3 + $rd brpoplpush c d 5 + after 1000 + assert_equal [r debug digest] [r -1 debug digest] + } + } +} + start_server {tags {"repl"}} { r set mykey foo @@ -26,7 +54,14 @@ start_server {tags {"repl"}} { test {SET on the master should immediately propagate} { r -1 set mykey bar + if {$::valgrind} {after 2000} r 0 get mykey } {bar} + + test {FLUSHALL should replicate} { + r -1 flushall + if {$::valgrind} {after 2000} + list [r -1 dbsize] [r 0 dbsize] + } {0 0} } }