Add dummy CLUSTER SLAVES call tests to fix reply ci (#12224)
In #12166, we removed a call to CLUSTER SLAVES, which then caused reply-schemas ci to fail: ``` WARNING! The following commands were not hit at all: cluster|slaves ERROR! at least one command was not hit by the tests ``` Because we already have command output that cover CLUSTER REPLICAS elsewhere, here we simply add some dummy tests to fix the ci.
This commit is contained in:
parent
4c74dd986f
commit
ec5721d6ca
@ -82,3 +82,8 @@ test "Coverage: CLUSTER HELP" {
|
|||||||
test "Coverage: ASKING" {
|
test "Coverage: ASKING" {
|
||||||
assert_equal {OK} [R 0 ASKING]
|
assert_equal {OK} [R 0 ASKING]
|
||||||
}
|
}
|
||||||
|
|
||||||
|
test "CLUSTER SLAVES and CLUSTER REPLICAS with zero replicas" {
|
||||||
|
assert_equal {} [R 0 cluster slaves [R 0 CLUSTER MYID]]
|
||||||
|
assert_equal {} [R 0 cluster replicas [R 0 CLUSTER MYID]]
|
||||||
|
}
|
||||||
|
@ -16,11 +16,20 @@ test "Cluster is up" {
|
|||||||
test "The first master has actually two slaves" {
|
test "The first master has actually two slaves" {
|
||||||
wait_for_condition 1000 50 {
|
wait_for_condition 1000 50 {
|
||||||
[llength [lindex [R 0 role] 2]] == 2
|
[llength [lindex [R 0 role] 2]] == 2
|
||||||
|
&& [llength [R 0 cluster replicas [R 0 CLUSTER MYID]]] == 2
|
||||||
} else {
|
} else {
|
||||||
fail "replicas didn't connect"
|
fail "replicas didn't connect"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
test "CLUSTER SLAVES and CLUSTER REPLICAS output is consistent" {
|
||||||
|
# Because we already have command output that cover CLUSTER REPLICAS elsewhere,
|
||||||
|
# here we simply judge whether their output is consistent to cover CLUSTER SLAVES.
|
||||||
|
set res [R 0 cluster slaves [R 0 CLUSTER MYID]]
|
||||||
|
set res2 [R 0 cluster replicas [R 0 CLUSTER MYID]]
|
||||||
|
assert_equal $res $res2
|
||||||
|
}
|
||||||
|
|
||||||
test {Slaves of #0 are instance #5 and #10 as expected} {
|
test {Slaves of #0 are instance #5 and #10 as expected} {
|
||||||
set port0 [get_instance_attrib redis 0 port]
|
set port0 [get_instance_attrib redis 0 port]
|
||||||
assert {[lindex [R 5 role] 2] == $port0}
|
assert {[lindex [R 5 role] 2] == $port0}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user