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
05dde719
Commit
05dde719
authored
Feb 19, 2014
by
antirez
Browse files
Sentinel test: some reliability fixes to 00-base tests.
parent
c499d82f
Changes
1
Hide whitespace changes
Inline
Side-by-side
tests/sentinel-tests/00-base.tcl
View file @
05dde719
# Check the basic monitoring and failover capabilities.
test
"Sentinels aren't monitoring any master"
{
test
"Sentinels aren't monitoring any master"
{
foreach_sentinel_id id
{
foreach_sentinel_id id
{
assert
{[
S $id sentinel masters
]
eq
{}}
assert
{[
S $id sentinel masters
]
eq
{}}
...
@@ -127,6 +129,7 @@ test "Failover is not possible without majority agreement" {
...
@@ -127,6 +129,7 @@ test "Failover is not possible without majority agreement" {
S $id SENTINEL MONITOR mymaster
\
S $id SENTINEL MONITOR mymaster
\
[
get_instance_attrib redis $master_id host
]
\
[
get_instance_attrib redis $master_id host
]
\
[
get_instance_attrib redis $master_id port
]
$quorum
[
get_instance_attrib redis $master_id port
]
$quorum
S $id SENTINEL SET mymaster down-after-milliseconds 2000
}
}
}
}
...
@@ -146,7 +149,7 @@ test "Failover works if we configure for absolute agreement" {
...
@@ -146,7 +149,7 @@ test "Failover works if we configure for absolute agreement" {
R $master_id debug sleep 5
R $master_id debug sleep 5
foreach_sentinel_id id
{
foreach_sentinel_id id
{
wait_for_condition 100 50
{
wait_for_condition 100
0
50
{
[
lindex
[
S $id SENTINEL GET-MASTER-ADDR-BY-NAME mymaster
]
1
]
!= $old_port
[
lindex
[
S $id SENTINEL GET-MASTER-ADDR-BY-NAME mymaster
]
1
]
!= $old_port
}
else
{
}
else
{
fail
"At least one Sentinel did not received failover info"
fail
"At least one Sentinel did not received failover info"
...
@@ -164,4 +167,3 @@ test "Failover works if we configure for absolute agreement" {
...
@@ -164,4 +167,3 @@ test "Failover works if we configure for absolute agreement" {
test
"New master
[
join $addr
{
:
}]
role matches"
{
test
"New master
[
join $addr
{
:
}]
role matches"
{
assert
{[
RI $master_id role
]
eq
{
master
}}
assert
{[
RI $master_id role
]
eq
{
master
}}
}
}
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