From 0e024808c23fd92e07f81104f17f3faeed787dad Mon Sep 17 00:00:00 2001 From: John Date: Mon, 11 May 2020 09:22:27 +0000 Subject: [PATCH] Make multimaster tests more reliable Former-commit-id: 4fe59ba11b720864ea0124885b358cb72127cc2d --- tests/integration/replication-multimaster.tcl | 23 +++++++++++-------- 1 file changed, 14 insertions(+), 9 deletions(-) diff --git a/tests/integration/replication-multimaster.tcl b/tests/integration/replication-multimaster.tcl index e5e77fdad..63ff51e60 100644 --- a/tests/integration/replication-multimaster.tcl +++ b/tests/integration/replication-multimaster.tcl @@ -47,10 +47,13 @@ start_server {overrides {hz 500 active-replica yes multi-master yes}} { after 500 $R(2) incr testkey after 500 - assert_equal 3 [$R(0) get testkey] - assert_equal 3 [$R(1) get testkey] - assert_equal 3 [$R(2) get testkey] - assert_equal 3 [$R(3) get testkey] + for {set n 0} {$n < 4} {incr n} { + wait_for_condition 50 1000 { + [$R($n) get testkey] == 3 + } else { + fail "node $n did not replicate" + } + } } test "$topology transaction replicates only once" { @@ -60,11 +63,13 @@ start_server {overrides {hz 500 active-replica yes multi-master yes}} { $R(0) incr testkey $R(0) incr testkey $R(0) exec - after 1 - assert_equal 3 [$R(0) get testkey] "node 0" - assert_equal 3 [$R(1) get testkey] "node 1" - assert_equal 3 [$R(2) get testkey] "node 2" - assert_equal 3 [$R(3) get testkey] "node 3" + for {set n 0} {$n < 4} {incr n} { + wait_for_condition 50 1000 { + [$R($n) get testkey] == 3 + } else { + fail "node $n failed to replicate" + } + } } } }