summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorantirez <antirez@gmail.com>2014-05-23 11:40:25 +0200
committerantirez <antirez@gmail.com>2014-05-23 11:40:34 +0200
commita700bc74a8094c6bcb310aab7b4494d880c5de6c (patch)
tree3436bafadef679f30dddf841b5f4af3f6399180f
parentb239a32aaee896fbff704b1aefffa18980b2e22d (diff)
downloadredis-a700bc74a8094c6bcb310aab7b4494d880c5de6c.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
-}