Skip to content

Commit

Permalink
Replcae sentinel commands sanity check with infrastructure work test
Browse files Browse the repository at this point in the history
The sanity check test intention was to detect that when a command is
added to sentinel it is on purpose. This test is easily broken, like
CLIENT SETINFO introduced by redis#11758.

We replace it with a test that validates that a few specific commands
are either there or missing (to test the infrastructure works correctly).
  • Loading branch information
enjoy-binbin committed Mar 22, 2023
1 parent ef50118 commit ae0e969
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions tests/sentinel/tests/00-base.tcl
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,19 @@ if {$::simulate_error} {
}
}

test "Sentinel commands sanity check" {
test "Sentinel command flag infrastructure works correctly" {
foreach_sentinel_id id {
assert_equal {72} [llength [S $id command list]]
assert_equal {15} [S $id command count]
set command_list [S $id command list]

foreach cmd {ping info subscribe client|setinfo} {
assert_not_equal [S $id command docs $cmd] {}
assert_not_equal [lsearch $command_list $cmd] -1
}

foreach cmd {save bgrewriteaof blpop replicaof client|no-touch} {
assert_equal [S $id command docs $cmd] {}
assert_equal [lsearch $command_list $cmd] -1
}
}
}

Expand Down

0 comments on commit ae0e969

Please sign in to comment.