From 6785b39eba761ccdcf8879ed19a8c3ac61f977f2 Mon Sep 17 00:00:00 2001 From: antirez Date: Tue, 10 Jun 2014 13:54:38 +0200 Subject: [PATCH] Cluster test: check master -> slave role switch. --- tests/cluster/tests/02-failover.tcl | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/tests/cluster/tests/02-failover.tcl b/tests/cluster/tests/02-failover.tcl index 2dff279a..2be22d33 100644 --- a/tests/cluster/tests/02-failover.tcl +++ b/tests/cluster/tests/02-failover.tcl @@ -33,3 +33,15 @@ test "Cluster is writable" { test "Instance #5 is now a master" { assert {[RI 5 role] eq {master}} } + +test "Restarting the previously killed master node" { + restart_instance redis 0 +} + +test "Instance #0 gets converted into a slave" { + wait_for_condition 1000 50 { + [RI 0 role] eq {slave} + } else { + fail "Old master was not converted into slave" + } +}