diff options
Diffstat (limited to 'tests/support')
-rw-r--r-- | tests/support/cluster_helper.tcl | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/tests/support/cluster_helper.tcl b/tests/support/cluster_helper.tcl index 42b99ca83..6d70e44c1 100644 --- a/tests/support/cluster_helper.tcl +++ b/tests/support/cluster_helper.tcl @@ -16,6 +16,16 @@ proc cluster_config_consistent {} { return 1 } +# Check if cluster size is consistent. +proc cluster_size_consistent {cluster_size} { + for {set j 0} {$j < $cluster_size} {incr j} { + if {[CI $j cluster_known_nodes] ne $cluster_size} { + return 0 + } + } + return 1 +} + # Wait for cluster configuration to propagate and be consistent across nodes. proc wait_for_cluster_propagation {} { wait_for_condition 50 100 { @@ -25,6 +35,15 @@ proc wait_for_cluster_propagation {} { } } +# Wait for cluster size to be consistent across nodes. +proc wait_for_cluster_size {cluster_size} { + wait_for_condition 50 100 { + [cluster_size_consistent $cluster_size] eq 1 + } else { + fail "cluster size did not reach a consistent size $cluster_size" + } +} + # Check that cluster nodes agree about "state", or raise an error. proc wait_for_cluster_state {state} { for {set j 0} {$j < [llength $::servers]} {incr j} { |