提交 80e808b6 编写于 作者: A antirez

EVAL replication test: less false positives.

wait_for_condition is now used instead of the usual "after 1000" (that
is the way to sleep in Tcl). This should avoid to find the replica in
a state where it is loading the RDB in memory, returning -LOADING error.

This test used to fail when running the test over valgrind, due to the
added latencies.
上级 51857c7e
......@@ -83,7 +83,7 @@ proc waitForBgrewriteaof r {
proc wait_for_sync r {
while 1 {
if {[status r master_link_status] eq "down"} {
if {[status $r master_link_status] eq "down"} {
after 10
} else {
break
......
......@@ -319,9 +319,13 @@ start_server {tags {"scripting repl"}} {
test {Connect a slave to the main instance} {
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 {Now use EVALSHA against the master} {
r evalsha ae3477e27be955de7e1bc9adfdca626b478d3cb2 0
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册