summaryrefslogtreecommitdiff
path: root/tests/cluster/tests/12-replica-migration-2.tcl
diff options
context:
space:
mode:
Diffstat (limited to 'tests/cluster/tests/12-replica-migration-2.tcl')
-rw-r--r--tests/cluster/tests/12-replica-migration-2.tcl18
1 files changed, 15 insertions, 3 deletions
diff --git a/tests/cluster/tests/12-replica-migration-2.tcl b/tests/cluster/tests/12-replica-migration-2.tcl
index aecae0429..679eaa3a4 100644
--- a/tests/cluster/tests/12-replica-migration-2.tcl
+++ b/tests/cluster/tests/12-replica-migration-2.tcl
@@ -6,6 +6,7 @@
source "../tests/includes/init-tests.tcl"
source "../../../tests/support/cli.tcl"
+source "../tests/includes/utils.tcl"
# Create a cluster with 5 master and 15 slaves, to make sure there are no
# empty masters and make rebalancing simpler to handle during the test.
@@ -29,6 +30,10 @@ test "Each master should have at least two replicas attached" {
}
}
+test "Wait cluster to be stable" {
+ wait_cluster_stable
+}
+
test "Set allow-replica-migration yes" {
foreach_redis_id id {
R $id CONFIG SET cluster-allow-replica-migration yes
@@ -53,10 +58,13 @@ test "Master #0 should lose its replicas" {
}
}
+# Wait for the cluster config to propagate before attempting a
+# new resharding.
+test "Wait cluster to be stable" {
+ wait_cluster_stable
+}
+
test "Resharding back some slot to master #0" {
- # Wait for the cluster config to propagate before attempting a
- # new resharding.
- after 10000
set output [exec \
../../../src/redis-cli --cluster rebalance \
127.0.0.1:[get_instance_attrib redis 0 port] \
@@ -65,6 +73,10 @@ test "Resharding back some slot to master #0" {
--cluster-use-empty-masters >@ stdout]
}
+test "Wait cluster to be stable" {
+ wait_cluster_stable
+}
+
test "Master #0 should re-acquire one or more replicas" {
wait_for_condition 1000 50 {
[llength [lindex [R 0 role] 2]] >= 1