diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-06-04 17:58:41 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-06-04 17:58:41 +0000 |
commit | 7aaff451bafb4b43e1626b329e59a4c9aa7fc31d (patch) | |
tree | ef3363c81916814c65c92fbbfa49f5cb2be77bba /tests/support/cluster_util.tcl | |
parent | Adding debian version 5:7.2.4-1. (diff) | |
download | redis-7aaff451bafb4b43e1626b329e59a4c9aa7fc31d.tar.xz redis-7aaff451bafb4b43e1626b329e59a4c9aa7fc31d.zip |
Merging upstream version 5:7.2.5.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'tests/support/cluster_util.tcl')
-rw-r--r-- | tests/support/cluster_util.tcl | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/tests/support/cluster_util.tcl b/tests/support/cluster_util.tcl index 2e3611e..5160466 100644 --- a/tests/support/cluster_util.tcl +++ b/tests/support/cluster_util.tcl @@ -199,3 +199,30 @@ proc are_hostnames_propagated {match_string} { } return 1 } + +proc wait_node_marked_fail {ref_node_index instance_id_to_check} { + wait_for_condition 1000 50 { + [check_cluster_node_mark fail $ref_node_index $instance_id_to_check] + } else { + fail "Replica node never marked as FAIL ('fail')" + } +} + +proc wait_node_marked_pfail {ref_node_index instance_id_to_check} { + wait_for_condition 1000 50 { + [check_cluster_node_mark fail\? $ref_node_index $instance_id_to_check] + } else { + fail "Replica node never marked as PFAIL ('fail?')" + } +} + +proc check_cluster_node_mark {flag ref_node_index instance_id_to_check} { + set nodes [get_cluster_nodes $ref_node_index] + + foreach n $nodes { + if {[dict get $n id] eq $instance_id_to_check} { + return [cluster_has_flag $n $flag] + } + } + fail "Unable to find instance id in cluster nodes. ID: $instance_id_to_check" +} |