summaryrefslogtreecommitdiff
path: root/tests/cluster
diff options
context:
space:
mode:
authorWen Hui <wen.hui.ware@gmail.com>2022-06-29 01:17:00 -0400
committerGitHub <noreply@github.com>2022-06-29 08:17:00 +0300
commit51da5c3dde38b138c68733977e53eee789e51d10 (patch)
tree916ed125695b21ef32ba7d2ef4fe3c7d6927542a /tests/cluster
parent35c2ee8716dc9b1d4edbbb409815a585af491335 (diff)
downloadredis-51da5c3dde38b138c68733977e53eee789e51d10.tar.gz
Fix CLUSTER RESET command argument number issue (#10898)
Fix regression of CLUSTER RESET command in redis 7.0. cluster reset command format is: CLUSTER RESET [ HARD | SOFT] According to the cluster reset command doc and codes, the third argument is optional, so the arity in json file should be -2 instead of 3. Add test to verify future regressions with RESET and RESET SOFT that were not covered. Co-authored-by: Ubuntu <lucas.guang.yang1@huawei.com> Co-authored-by: Oran Agra <oran@redislabs.com> Co-authored-by: Binbin <binloveplay1314@qq.com>
Diffstat (limited to 'tests/cluster')
-rw-r--r--tests/cluster/tests/00-base.tcl13
1 files changed, 13 insertions, 0 deletions
diff --git a/tests/cluster/tests/00-base.tcl b/tests/cluster/tests/00-base.tcl
index 12d8244a8..e9e99baaa 100644
--- a/tests/cluster/tests/00-base.tcl
+++ b/tests/cluster/tests/00-base.tcl
@@ -80,3 +80,16 @@ test "Script no-cluster flag" {
assert_match {*Can not run script on cluster, 'no-cluster' flag is set*} $e
}
+
+test "CLUSTER RESET SOFT test" {
+ set last_epoch_node0 [get_info_field [R 0 cluster info] cluster_current_epoch]
+ R 0 FLUSHALL
+ R 0 CLUSTER RESET
+ assert {[get_info_field [R 0 cluster info] cluster_current_epoch] eq $last_epoch_node0}
+
+ set last_epoch_node1 [get_info_field [R 1 cluster info] cluster_current_epoch]
+ R 1 FLUSHALL
+ R 1 CLUSTER RESET SOFT
+ assert {[get_info_field [R 1 cluster info] cluster_current_epoch] eq $last_epoch_node1}
+}
+