summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorantirez <antirez@gmail.com>2012-04-30 10:55:03 +0200
committerantirez <antirez@gmail.com>2012-04-30 11:50:42 +0200
commitfc7ea2f7cd128ad3a2e8c0acf838015e0d330934 (patch)
tree09afa16ed4bb9d48e4e3c98a74ee8d3b82893440
parentfb38fd3c8902e2621cbb5237e324f45da224b7de (diff)
downloadredis-fc7ea2f7cd128ad3a2e8c0acf838015e0d330934.tar.gz
Properly wait the slave to sync with master in BRPOPLPUSH test.
-rw-r--r--tests/integration/replication.tcl10
1 files changed, 7 insertions, 3 deletions
diff --git a/tests/integration/replication.tcl b/tests/integration/replication.tcl
index bc0ffb410..278496a87 100644
--- a/tests/integration/replication.tcl
+++ b/tests/integration/replication.tcl
@@ -2,9 +2,13 @@ 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}
+ wait_for_condition 50 100 {
+ [s -1 role] eq {slave} &&
+ [string match {*master_link_status:up*} [r -1 info]]
+ } else {
+ fail "Can't turn the instance into a slave"
+ }
+ }
test {BRPOPLPUSH replication, when blocking against empty list} {
set rd [redis_deferring_client]