mirror of
https://github.com/fluencelabs/redis
synced 2025-03-18 08:30:51 +00:00
Cluster test: failure detection initial tests.
This commit is contained in:
parent
4c04744734
commit
a7da78e472
31
tests/cluster/tests/01-faildet.tcl
Normal file
31
tests/cluster/tests/01-faildet.tcl
Normal file
@ -0,0 +1,31 @@
|
||||
# Check the basic monitoring and failover capabilities.
|
||||
|
||||
source "../tests/includes/init-tests.tcl"
|
||||
|
||||
proc create_cluster {masters slaves} {
|
||||
cluster_allocate_slots $masters
|
||||
if {$slaves} {
|
||||
cluster_allocate_slaves $masters $slaves
|
||||
}
|
||||
assert_cluster_state ok
|
||||
}
|
||||
|
||||
test "Create a 5 nodes cluster" {
|
||||
create_cluster 5 0
|
||||
}
|
||||
|
||||
test "Killing one master node" {
|
||||
kill_instance redis 0
|
||||
}
|
||||
|
||||
test "Cluster should be down now" {
|
||||
assert_cluster_state fail
|
||||
}
|
||||
|
||||
test "Restarting master node" {
|
||||
restart_instance redis 0
|
||||
}
|
||||
|
||||
test "Cluster should be up again" {
|
||||
assert_cluster_state ok
|
||||
}
|
@ -23,6 +23,7 @@ test "Cluster nodes hard reset" {
|
||||
foreach_redis_id id {
|
||||
R $id flushall
|
||||
R $id cluster reset hard
|
||||
R $id config set cluster-node-timeout 3000
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user