summaryrefslogtreecommitdiff
path: root/tests/integration/replication-2.tcl
diff options
context:
space:
mode:
authorOran Agra <oran@redislabs.com>2021-02-15 12:50:23 +0200
committerGitHub <noreply@github.com>2021-02-15 12:50:23 +0200
commit30775bc3e3a919e6a168523e772551332738e9f3 (patch)
tree95bf129070e8509d6c96e9bdec49fff2eafe43d2 /tests/integration/replication-2.tcl
parent0bc8c9c8f975f326c2ce87a0759b8b65b94a4120 (diff)
downloadredis-30775bc3e3a919e6a168523e772551332738e9f3.tar.gz
solve race in replication-2 test - again (#8491)
this should make it timing independent and also faster in most cases
Diffstat (limited to 'tests/integration/replication-2.tcl')
-rw-r--r--tests/integration/replication-2.tcl10
1 files changed, 7 insertions, 3 deletions
diff --git a/tests/integration/replication-2.tcl b/tests/integration/replication-2.tcl
index fc67e78c1..9524f3563 100644
--- a/tests/integration/replication-2.tcl
+++ b/tests/integration/replication-2.tcl
@@ -43,10 +43,14 @@ start_server {tags {"repl"}} {
r config set min-slaves-max-lag 2
exec kill -SIGSTOP [srv -1 pid]
assert {[r set foo 12345] eq {OK}}
- after 4000
+ wait_for_condition 100 100 {
+ [catch {r set foo 12345}] != 0
+ } else {
+ fail "Master didn't become readonly"
+ }
catch {r set foo 12345} err
- set err
- } {NOREPLICAS*}
+ assert_match {NOREPLICAS*} $err
+ }
exec kill -SIGCONT [srv -1 pid]
test {min-slaves-to-write is ignored by slaves} {