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
d06d8d6f
Commit
d06d8d6f
authored
Jun 19, 2014
by
antirez
Browse files
Sentinel test: unit 02, avoid some time related false positives.
parent
41f12ac9
Changes
1
Hide whitespace changes
Inline
Side-by-side
tests/sentinel/tests/02-slaves-reconf.tcl
View file @
d06d8d6f
...
@@ -7,7 +7,7 @@
...
@@ -7,7 +7,7 @@
source
"../tests/includes/init-tests.tcl"
source
"../tests/includes/init-tests.tcl"
proc 0
3
_test_slaves_replication
{}
{
proc 0
2
_test_slaves_replication
{}
{
uplevel 1
{
uplevel 1
{
test
"Check that slaves replicate from current master"
{
test
"Check that slaves replicate from current master"
{
set master_port
[
RI $master_id tcp_port
]
set master_port
[
RI $master_id tcp_port
]
...
@@ -15,7 +15,8 @@ proc 03_test_slaves_replication {} {
...
@@ -15,7 +15,8 @@ proc 03_test_slaves_replication {} {
if
{
$id
== $master_id
}
continue
if
{
$id
== $master_id
}
continue
if
{[
instance_is_killed redis $id
]}
continue
if
{[
instance_is_killed redis $id
]}
continue
wait_for_condition 1000 50
{
wait_for_condition 1000 50
{
[
RI $id master_port
]
== $master_port
([
RI $id master_port
]
== $master_port
)
&&
([
RI $id master_link_status
]
eq
{
up
})
}
else
{
}
else
{
fail
"Redis slave
$id
is replicating from wrong master"
fail
"Redis slave
$id
is replicating from wrong master"
}
}
...
@@ -24,7 +25,7 @@ proc 03_test_slaves_replication {} {
...
@@ -24,7 +25,7 @@ proc 03_test_slaves_replication {} {
}
}
}
}
proc 0
3
_crash_and_failover
{}
{
proc 0
2
_crash_and_failover
{}
{
uplevel 1
{
uplevel 1
{
test
"Crash the master and force a failover"
{
test
"Crash the master and force a failover"
{
set old_port
[
RI $master_id tcp_port
]
set old_port
[
RI $master_id tcp_port
]
...
@@ -45,9 +46,9 @@ proc 03_crash_and_failover {} {
...
@@ -45,9 +46,9 @@ proc 03_crash_and_failover {} {
}
}
}
}
0
3
_test_slaves_replication
0
2
_test_slaves_replication
0
3
_crash_and_failover
0
2
_crash_and_failover
0
3
_test_slaves_replication
0
2
_test_slaves_replication
test
"Kill a slave instance"
{
test
"Kill a slave instance"
{
foreach_redis_id id
{
foreach_redis_id id
{
...
@@ -58,8 +59,8 @@ test "Kill a slave instance" {
...
@@ -58,8 +59,8 @@ test "Kill a slave instance" {
}
}
}
}
0
3
_crash_and_failover
0
2
_crash_and_failover
0
3
_test_slaves_replication
0
2
_test_slaves_replication
test
"Wait for failover to end"
{
test
"Wait for failover to end"
{
set inprogress 1
set inprogress 1
...
@@ -80,4 +81,4 @@ test "Restart killed slave and test replication of slaves again..." {
...
@@ -80,4 +81,4 @@ test "Restart killed slave and test replication of slaves again..." {
# Now we check if the slave rejoining the partition is reconfigured even
# Now we check if the slave rejoining the partition is reconfigured even
# if the failover finished.
# if the failover finished.
0
3
_test_slaves_replication
0
2
_test_slaves_replication
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