diff --git a/tests/integration/psync2-pingoff.tcl b/tests/integration/psync2-pingoff.tcl index 1cea290e70d96ac05e42b3cfb97f422ba0ef148c..420747d2183348b214969699e8c0f03aa84a9857 100644 --- a/tests/integration/psync2-pingoff.tcl +++ b/tests/integration/psync2-pingoff.tcl @@ -20,6 +20,7 @@ start_server {} { $R(1) replicaof $R_host(0) $R_port(0) $R(0) set foo bar wait_for_condition 50 1000 { + [status $R(1) master_link_status] == "up" && [$R(0) dbsize] == 1 && [$R(1) dbsize] == 1 } else { fail "Replicas not replicating from master" diff --git a/tests/integration/psync2-reg.tcl b/tests/integration/psync2-reg.tcl index b5ad021e274f314faef4759c95348b3e77e3d8f5..71a1c0eb2005ac06e7aae0391744bc5d079b4339 100644 --- a/tests/integration/psync2-reg.tcl +++ b/tests/integration/psync2-reg.tcl @@ -28,7 +28,10 @@ start_server {} { $R(2) slaveof $R_host(0) $R_port(0) $R(0) set foo bar wait_for_condition 50 1000 { - [$R(1) dbsize] == 1 && [$R(2) dbsize] == 1 + [status $R(1) master_link_status] == "up" && + [status $R(2) master_link_status] == "up" && + [$R(1) dbsize] == 1 && + [$R(2) dbsize] == 1 } else { fail "Replicas not replicating from master" } diff --git a/tests/integration/psync2.tcl b/tests/integration/psync2.tcl index 4e1189e0b9a655f3c005ea36d66002cdaa807bdb..5fe29caba82c71a1512a2f3dffbcb172f1234a70 100644 --- a/tests/integration/psync2.tcl +++ b/tests/integration/psync2.tcl @@ -67,6 +67,16 @@ start_server {} { lappend used $slave_id } + # Wait for replicas to sync. so next loop won't get -LOADING error + wait_for_condition 50 1000 { + [status $R([expr {($master_id+1)%5}]) master_link_status] == "up" && + [status $R([expr {($master_id+2)%5}]) master_link_status] == "up" && + [status $R([expr {($master_id+3)%5}]) master_link_status] == "up" && + [status $R([expr {($master_id+4)%5}]) master_link_status] == "up" + } else { + fail "Replica not reconnecting" + } + # 3) Increment the counter and wait for all the instances # to converge. test "PSYNC2: cluster is consistent after failover" {