summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorantirez <antirez@gmail.com>2014-05-23 11:40:25 +0200
committerantirez <antirez@gmail.com>2014-05-23 15:54:53 +0200
commit81af783fecfd303a68a840116e79478ba2d400d1 (patch)
treeaa9c04543d8d65d896b059f19ecd64f465083af6
parente62e3c4cb2366bec5a892bae913f99636868cee9 (diff)
downloadredis-81af783fecfd303a68a840116e79478ba2d400d1.tar.gz
Cluster test: more reliable 01-faildet unit.
Do things in a sequence that prevents failover during failure detection.
-rw-r--r--tests/cluster/tests/01-faildet.tcl24
1 files changed, 15 insertions, 9 deletions
diff --git a/tests/cluster/tests/01-faildet.tcl b/tests/cluster/tests/01-faildet.tcl
index a31f7eb67..8fe87c91f 100644
--- a/tests/cluster/tests/01-faildet.tcl
+++ b/tests/cluster/tests/01-faildet.tcl
@@ -6,10 +6,25 @@ test "Create a 5 nodes cluster" {
create_cluster 5 5
}
+test "Cluster should start ok" {
+ assert_cluster_state ok
+}
+
+test "Killing two slave nodes" {
+ kill_instance redis 5
+ kill_instance redis 6
+}
+
+test "Cluster should be still up" {
+ assert_cluster_state ok
+}
+
test "Killing one master node" {
kill_instance redis 0
}
+# Note: the only slave of instance 0 is already down so no
+# failover is possible, that would change the state back to ok.
test "Cluster should be down now" {
assert_cluster_state fail
}
@@ -21,12 +36,3 @@ test "Restarting master node" {
test "Cluster should be up again" {
assert_cluster_state ok
}
-
-test "Killing two slave nodes" {
- kill_instance redis 5
- kill_instance redis 6
-}
-
-test "Cluster should be still up" {
- assert_cluster_state ok
-}