From a7f552ef3a4c3d4cf62626ae2ccb6e9b1331ea03 Mon Sep 17 00:00:00 2001 From: Yossi Gottlieb Date: Tue, 2 Mar 2021 18:12:11 +0200 Subject: [PATCH] Fix potential replication-4 test race condition. (#8583) Co-authored-by: Oran Agra --- tests/integration/replication-4.tcl | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/tests/integration/replication-4.tcl b/tests/integration/replication-4.tcl index c867001b8..8715ae999 100644 --- a/tests/integration/replication-4.tcl +++ b/tests/integration/replication-4.tcl @@ -79,12 +79,16 @@ start_server {tags {"repl"}} { $master config set min-slaves-max-lag 2 $master config set min-slaves-to-write 1 assert {[$master set foo bar] eq {OK}} - $slave deferred 1 - $slave debug sleep 6 - after 4000 - catch {$master set foo bar} e - set e - } {NOREPLICAS*} + exec kill -SIGSTOP [srv 0 pid] + wait_for_condition 100 100 { + [catch {$master set foo bar}] != 0 + } else { + fail "Master didn't become readonly" + } + catch {$master set foo bar} err + assert_match {NOREPLICAS*} $err + exec kill -SIGCONT [srv 0 pid] + } } }