mirror of
https://github.com/fluencelabs/redis
synced 2025-04-22 00:52:13 +00:00
Cluster test: added function assert_cluster_state.
This commit is contained in:
parent
60e5d1724c
commit
0b7aa26164
@ -61,3 +61,15 @@ proc cluster_allocate_slots {n} {
|
|||||||
R $j cluster addslots {*}[set slots_${j}]
|
R $j cluster addslots {*}[set slots_${j}]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# Check that cluster nodes agree about "state", or raise an error.
|
||||||
|
proc assert_cluster_state {state} {
|
||||||
|
foreach_redis_id id {
|
||||||
|
if {[instance_is_killed redis $id]} continue
|
||||||
|
wait_for_condition 1000 50 {
|
||||||
|
[CI $id cluster_state] eq $state
|
||||||
|
} else {
|
||||||
|
fail "Cluster node $id cluster_state:[CI $id cluster_state]"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
@ -52,9 +52,7 @@ test "Check if nodes auto-discovery works" {
|
|||||||
}
|
}
|
||||||
|
|
||||||
test "Before slots allocation, all nodes report cluster failure" {
|
test "Before slots allocation, all nodes report cluster failure" {
|
||||||
foreach_redis_id id {
|
assert_cluster_state fail
|
||||||
assert {[CI $id cluster_state] eq {fail}}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
test "It is possible to perform slot allocation" {
|
test "It is possible to perform slot allocation" {
|
||||||
@ -86,13 +84,7 @@ test "After the join, every node gets a different config epoch" {
|
|||||||
}
|
}
|
||||||
|
|
||||||
test "Nodes should report cluster_state is ok now" {
|
test "Nodes should report cluster_state is ok now" {
|
||||||
foreach_redis_id id {
|
assert_cluster_state ok
|
||||||
wait_for_condition 1000 50 {
|
|
||||||
[CI $id cluster_state] eq {ok}
|
|
||||||
} else {
|
|
||||||
fail "Cluster node $id cluster_state:[CI $id cluster_state]"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
test "It is possible to write and read from the cluster" {
|
test "It is possible to write and read from the cluster" {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user