summaryrefslogtreecommitdiff
path: root/tests/cluster
diff options
context:
space:
mode:
authorYossi Gottlieb <yossigo@gmail.com>2021-04-13 00:00:57 +0300
committerGitHub <noreply@github.com>2021-04-13 00:00:57 +0300
commit5e3a15ae1b58630a10639b34cd016ba9c0ff6b15 (patch)
treea973569e93d6a676c3736e61d719646babbc0872 /tests/cluster
parenta0e19e3cf153ffbd8b1c7e72249d22b92f71532f (diff)
downloadredis-5e3a15ae1b58630a10639b34cd016ba9c0ff6b15.tar.gz
Fix failing cluster tests. (#8763)
Disable replica migration to avoid a race condition where the migrated-from node turns into a replica. Long term, this test should probably be improved to handle multiple slots and accept such auto migrations but this is a quick fix to stabilize the CI without completely dropping this test.
Diffstat (limited to 'tests/cluster')
-rw-r--r--tests/cluster/cluster.tcl2
-rw-r--r--tests/cluster/tests/20-half-migrated-slot.tcl3
-rw-r--r--tests/cluster/tests/21-many-slot-migration.tcl2
-rw-r--r--tests/cluster/tests/includes/utils.tcl6
4 files changed, 12 insertions, 1 deletions
diff --git a/tests/cluster/cluster.tcl b/tests/cluster/cluster.tcl
index fb10fffcc..e95789282 100644
--- a/tests/cluster/cluster.tcl
+++ b/tests/cluster/cluster.tcl
@@ -174,4 +174,4 @@ proc wait_for_cluster_propagation {} {
} else {
fail "cluster config did not reach a consistent state"
}
-} \ No newline at end of file
+}
diff --git a/tests/cluster/tests/20-half-migrated-slot.tcl b/tests/cluster/tests/20-half-migrated-slot.tcl
index 69a90818c..e78867961 100644
--- a/tests/cluster/tests/20-half-migrated-slot.tcl
+++ b/tests/cluster/tests/20-half-migrated-slot.tcl
@@ -9,6 +9,7 @@ source "../tests/includes/utils.tcl"
test "Create a 2 nodes cluster" {
create_cluster 2 0
+ config_set_all_nodes cluster-allow-replica-migration no
}
test "Cluster is up" {
@@ -87,3 +88,5 @@ test "Half-finish importing" {
fix_cluster $nodefrom(addr)
assert_equal "xyz" [$cluster get aga]
}
+
+config_set_all_nodes cluster-allow-replica-migration yes
diff --git a/tests/cluster/tests/21-many-slot-migration.tcl b/tests/cluster/tests/21-many-slot-migration.tcl
index 18daff1d4..22020505c 100644
--- a/tests/cluster/tests/21-many-slot-migration.tcl
+++ b/tests/cluster/tests/21-many-slot-migration.tcl
@@ -9,6 +9,7 @@ source "../tests/includes/utils.tcl"
test "Create a 10 nodes cluster" {
create_cluster 10 0
+ config_set_all_nodes cluster-allow-replica-migration no
}
test "Cluster is up" {
@@ -54,3 +55,4 @@ test "Keys are accessible" {
}
}
+config_set_all_nodes cluster-allow-replica-migration yes
diff --git a/tests/cluster/tests/includes/utils.tcl b/tests/cluster/tests/includes/utils.tcl
index 43a2f2803..48c40a050 100644
--- a/tests/cluster/tests/includes/utils.tcl
+++ b/tests/cluster/tests/includes/utils.tcl
@@ -1,5 +1,11 @@
source "../../../tests/support/cli.tcl"
+proc config_set_all_nodes {keyword value} {
+ foreach_redis_id id {
+ R $id config set $keyword $value
+ }
+}
+
proc fix_cluster {addr} {
set code [catch {
exec ../../../src/redis-cli {*}[rediscli_tls_config "../../../tests"] --cluster fix $addr << yes