Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
ruanhaishen
redis
Commits
4c72a09b
Unverified
Commit
4c72a09b
authored
Jun 19, 2022
by
Moti Cohen
Committed by
GitHub
Jun 19, 2022
Browse files
Fix sentinel acl change test. Timing issue. (#10868)
Co-authored-by:
moticless
<
moticless@github.com
>
parent
f2387daa
Changes
1
Hide whitespace changes
Inline
Side-by-side
tests/sentinel/tests/03-runtime-reconf.tcl
View file @
4c72a09b
...
...
@@ -126,7 +126,7 @@ test "Sentinels (re)connection following master ACL change" {
wait_for_condition 100 50
{
[
string match
"*disconnected*"
[
dict get
[
S $sent2re SENTINEL MASTER mymaster
]
flags
]]
!= 0
}
else
{
fail
"Expected:
S
entinel to be disconnected from master due to
wrong
password"
fail
"Expected:
Restarted s
entinel to be disconnected from master due to
obsolete
password"
}
# Verify sentinel with updated password managed to connect
(
wait for sentinelTimer to reconnect
)
...
...
@@ -137,8 +137,10 @@ test "Sentinels (re)connection following master ACL change" {
}
# Verify sentinel untouched gets failed to connect master
if
{
!
[
string match
"*disconnected*"
[
dict get
[
S $sent2un SENTINEL MASTER mymaster
]
flags
]]}
{
fail
"Expected: Sentinel to be disconnected from master due to wrong password"
wait_for_condition 100 50
{
[
string match
"*disconnected*"
[
dict get
[
S $sent2un SENTINEL MASTER mymaster
]
flags
]]
!= 0
}
else
{
fail
"Expected: Sentinel to be disconnected from master due to obsolete password"
}
# Now update all sentinels with new password
...
...
@@ -167,14 +169,14 @@ test "Set parameters in normal case" {
set origin_down_after_milliseconds
[
dict get $info down-after-milliseconds
]
set update_quorum
[
expr $origin_quorum+1
]
set update_down_after_milliseconds
[
expr $origin_down_after_milliseconds+1000
]
assert_equal
[
S 0 SENTINEL SET mymaster quorum $update_quorum
]
"OK"
assert_equal
[
S 0 SENTINEL SET mymaster down-after-milliseconds $update_down_after_milliseconds
]
"OK"
set update_info
[
S 0 SENTINEL master mymaster
]
assert
{[
dict get $update_info quorum
]
!= $origin_quorum
}
assert
{[
dict get $update_info down-after-milliseconds
]
!= $origin_down_after_milliseconds
}
#restore to origin config parameters
assert_equal
[
S 0 SENTINEL SET mymaster quorum $origin_quorum
]
"OK"
assert_equal
[
S 0 SENTINEL SET mymaster down-after-milliseconds $origin_down_after_milliseconds
]
"OK"
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment