summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorantirez <antirez@gmail.com>2016-05-05 11:49:27 +0200
committerantirez <antirez@gmail.com>2016-05-05 11:57:49 +0200
commit4c53bab17b936c9875bfd884a30686ed1c438d67 (patch)
tree75bf27ed20b7825bce6e9d678246fc57e1f7e1ff /tests
parent971e3c51b63e7a5ced6a953bdfd2d9bd53b25e52 (diff)
downloadredis-4c53bab17b936c9875bfd884a30686ed1c438d67.tar.gz
Cluster test 12: reshard back just a few slots to speedup the test.
Diffstat (limited to 'tests')
-rw-r--r--tests/cluster/tests/12-replica-migration-2.tcl14
1 files changed, 7 insertions, 7 deletions
diff --git a/tests/cluster/tests/12-replica-migration-2.tcl b/tests/cluster/tests/12-replica-migration-2.tcl
index cd8b33b3e..48ecd1d50 100644
--- a/tests/cluster/tests/12-replica-migration-2.tcl
+++ b/tests/cluster/tests/12-replica-migration-2.tcl
@@ -6,21 +6,21 @@
source "../tests/includes/init-tests.tcl"
-# Create a cluster with 5 master and 10 slaves, so that we have 2
-# slaves for each master.
+# 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.
test "Create a 5 nodes cluster" {
- create_cluster 5 10
+ create_cluster 5 15
}
test "Cluster is up" {
assert_cluster_state ok
}
-test "Each master should have two replicas attached" {
+test "Each master should have at least two replicas attached" {
foreach_redis_id id {
if {$id < 5} {
wait_for_condition 1000 50 {
- [llength [lindex [R 0 role] 2]] == 2
+ [llength [lindex [R 0 role] 2]] >= 2
} else {
fail "Master #$id does not have 2 slaves as expected"
}
@@ -44,13 +44,13 @@ test "Master #0 should lose its replicas" {
}
}
-test "Resharding all the master #0 slots back to it" {
+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-trib.rb rebalance \
- --weight ${master0_id}=1 \
+ --weight ${master0_id}=.01 \
--use-empty-masters \
127.0.0.1:[get_instance_attrib redis 0 port] >@ stdout]
}