Commit 3f126567 authored by antirez's avatar antirez
Browse files

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.
parent 591c9e65
...@@ -83,7 +83,7 @@ proc waitForBgrewriteaof r { ...@@ -83,7 +83,7 @@ proc waitForBgrewriteaof r {
proc wait_for_sync r { proc wait_for_sync r {
while 1 { while 1 {
if {[status r master_link_status] eq "down"} { if {[status $r master_link_status] eq "down"} {
after 10 after 10
} else { } else {
break break
......
...@@ -319,9 +319,13 @@ start_server {tags {"scripting repl"}} { ...@@ -319,9 +319,13 @@ start_server {tags {"scripting repl"}} {
test {Connect a slave to the main instance} { test {Connect a slave to the main instance} {
r -1 slaveof [srv 0 host] [srv 0 port] r -1 slaveof [srv 0 host] [srv 0 port]
after 1000 wait_for_condition 50 100 {
s -1 role [s -1 role] eq {slave} &&
} {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} { test {Now use EVALSHA against the master} {
r evalsha ae3477e27be955de7e1bc9adfdca626b478d3cb2 0 r evalsha ae3477e27be955de7e1bc9adfdca626b478d3cb2 0
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment