summaryrefslogtreecommitdiff
path: root/tests/cluster
diff options
context:
space:
mode:
authorOran Agra <oran@redislabs.com>2021-10-31 19:22:21 +0200
committerGitHub <noreply@github.com>2021-10-31 19:22:21 +0200
commit48d54265ce16cff0764b0aad7b56e091401b3d4b (patch)
tree46013178ddf7d8f33cf3312ca847ffce61912339 /tests/cluster
parentf26e90be0ccad273a8b7a71dfecaa4db43bfff29 (diff)
downloadredis-48d54265ce16cff0764b0aad7b56e091401b3d4b.tar.gz
Fix failing cluster tests (#9707)
Fix failures introduced by #9695 which was an attempt to solve failures introduced by #9679. And alternative to #9703 (i didn't like the extra argument to kill_instance). Reverting #9695. Instead of stopping AOF on all terminations, stop it only on the two which need it. Do it as part of the test rather than the infra (it was add that kill_instance used `R` to communicate to the instance) Note that the original purpose of these tests was to trigger a crash, but that upsets valgrind so in redis 6.2 i changed it to use SIGTERM, so i now rename the tests (remove "kill" and "crash"). Also add some colors to failures, and the word "FAILED" so that it's searchable. And solve a semi-related race condition in 14-consistency-check.tcl
Diffstat (limited to 'tests/cluster')
-rw-r--r--tests/cluster/tests/03-failover-loop.tcl4
-rw-r--r--tests/cluster/tests/04-resharding.tcl6
-rw-r--r--tests/cluster/tests/14-consistency-check.tcl3
3 files changed, 9 insertions, 4 deletions
diff --git a/tests/cluster/tests/03-failover-loop.tcl b/tests/cluster/tests/03-failover-loop.tcl
index 5c84b2604..46c22a913 100644
--- a/tests/cluster/tests/03-failover-loop.tcl
+++ b/tests/cluster/tests/03-failover-loop.tcl
@@ -61,7 +61,9 @@ while {[incr iterations -1]} {
}
}
- test "Killing node #$tokill" {
+ test "Terminating node #$tokill" {
+ # Stop AOF so that an initial AOFRW won't prevent the instance from terminating
+ R $tokill config set appendonly no
kill_instance redis $tokill
}
diff --git a/tests/cluster/tests/04-resharding.tcl b/tests/cluster/tests/04-resharding.tcl
index 4d31d314c..18a26bda6 100644
--- a/tests/cluster/tests/04-resharding.tcl
+++ b/tests/cluster/tests/04-resharding.tcl
@@ -137,8 +137,10 @@ test "Verify $numkeys keys for consistency with logical content" {
}
}
-test "Crash and restart all the instances" {
+test "Terminate and restart all the instances" {
foreach_redis_id id {
+ # Stop AOF so that an initial AOFRW won't prevent the instance from terminating
+ R $id config set appendonly no
kill_instance redis $id
restart_instance redis $id
}
@@ -148,7 +150,7 @@ test "Cluster should eventually be up again" {
assert_cluster_state ok
}
-test "Verify $numkeys keys after the crash & restart" {
+test "Verify $numkeys keys after the restart" {
# Check that the Redis Cluster content matches our logical content.
foreach {key value} [array get content] {
if {[$cluster lrange $key 0 -1] ne $value} {
diff --git a/tests/cluster/tests/14-consistency-check.tcl b/tests/cluster/tests/14-consistency-check.tcl
index d182693d8..98a49dbcd 100644
--- a/tests/cluster/tests/14-consistency-check.tcl
+++ b/tests/cluster/tests/14-consistency-check.tcl
@@ -77,9 +77,10 @@ proc test_slave_load_expired_keys {aof} {
# we need to wait for the initial AOFRW to be done, otherwise
# kill_instance (which now uses SIGTERM will fail ("Writing initial AOF, can't exit")
wait_for_condition 100 10 {
+ [RI $replica_id aof_rewrite_scheduled] eq 0 &&
[RI $replica_id aof_rewrite_in_progress] eq 0
} else {
- fail "keys didn't expire"
+ fail "AOFRW didn't finish"
}
} else {
R $replica_id save