Fix sentinel ACL test. Timing issue. (#10510)

Fix by replacing in test blind sleep with wait_for_condition().

Co-authored-by: moticless <moticless@github.com>
This commit is contained in:
Moti Cohen 2022-04-03 10:56:15 +03:00 committed by GitHub
parent b53c7f2c0b
commit 37beb5e67e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -31,16 +31,23 @@ test "(post-init) Set up ACL configuration" {
test "SENTINEL CONFIG SET handles on-the-fly credentials reconfiguration" {
# Make sure we're starting with a broken state...
after 5000
catch {S 1 SENTINEL CKQUORUM mymaster} err
assert_match {*NOQUORUM*} $err
wait_for_condition 200 50 {
[catch {S 1 SENTINEL CKQUORUM mymaster}] == 1
} else {
fail "Expected: Sentinel to be disconnected from master due to wrong password"
}
assert_error "*NOQUORUM*" {S 1 SENTINEL CKQUORUM mymaster}
foreach_sentinel_id id {
assert_equal {OK} [S $id SENTINEL CONFIG SET sentinel-user $::user]
assert_equal {OK} [S $id SENTINEL CONFIG SET sentinel-pass $::password]
}
after 5000
wait_for_condition 200 50 {
[catch {S 1 SENTINEL CKQUORUM mymaster}] == 0
} else {
fail "Expected: Sentinel to be connected to master after setting password"
}
assert_match {*OK*} [S 1 SENTINEL CKQUORUM mymaster]
}