Fix sentinel disconnect test timing issue after auth-pass change (#10784)
There is a timing issue reported in test-sanitizer-address (gcc): ``` Sentinels (re)connection following SENTINEL SET mymaster auth-pass: FAILED: Expected to be disconnected from master due to wrong password ``` The reason we reach it, is because the test is fast enough to modify auth-pass and test sentinel connection status with the server, before its scheduled operation got the chance to update connection status with the server. We need to wait for `sentinelTimer` to kick in, and then update the connection status. Replace condition with wait_for_condition on the check. Fix just like #10480 did
This commit is contained in:
parent
6461f09f43
commit
1013cbeae2
@ -79,8 +79,10 @@ test "Sentinels (re)connection following SENTINEL SET mymaster auth-pass" {
|
||||
restart_instance sentinel $sent2re
|
||||
|
||||
# Verify sentinel that restarted failed to connect master
|
||||
if {![string match "*disconnected*" [dict get [S $sent2re SENTINEL MASTER mymaster] flags]]} {
|
||||
fail "Expected to be disconnected from master due to wrong password"
|
||||
wait_for_condition 100 50 {
|
||||
[string match "*disconnected*" [dict get [S $sent2re SENTINEL MASTER mymaster] flags]] != 0
|
||||
} else {
|
||||
fail "Expected to be disconnected from master due to wrong password"
|
||||
}
|
||||
|
||||
# Update restarted sentinel with master password
|
||||
|
Loading…
x
Reference in New Issue
Block a user