From d9241b35e5f279682cb0b4bdebaed86be2405d36 Mon Sep 17 00:00:00 2001 From: antirez Date: Mon, 30 Apr 2012 10:55:03 +0200 Subject: [PATCH] Properly wait the slave to sync with master in BRPOPLPUSH test. --- tests/integration/replication.tcl | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/tests/integration/replication.tcl b/tests/integration/replication.tcl index 71a22f69..18e639d4 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 replication]] + } else { + fail "Can't turn the instance into a slave" + } + } test {BRPOPLPUSH replication, when blocking against empty list} { set rd [redis_deferring_client] -- 2.45.2