Sentinel test: unit 02, avoid some time related false positives.

This commit is contained in:
antirez 2014-06-19 15:56:28 +02:00
parent 41f12ac988
commit d06d8d6ffa

View File

@ -7,7 +7,7 @@
source "../tests/includes/init-tests.tcl"
proc 03_test_slaves_replication {} {
proc 02_test_slaves_replication {} {
uplevel 1 {
test "Check that slaves replicate from current master" {
set master_port [RI $master_id tcp_port]
@ -15,7 +15,8 @@ proc 03_test_slaves_replication {} {
if {$id == $master_id} continue
if {[instance_is_killed redis $id]} continue
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 {
fail "Redis slave $id is replicating from wrong master"
}
@ -24,7 +25,7 @@ proc 03_test_slaves_replication {} {
}
}
proc 03_crash_and_failover {} {
proc 02_crash_and_failover {} {
uplevel 1 {
test "Crash the master and force a failover" {
set old_port [RI $master_id tcp_port]
@ -45,9 +46,9 @@ proc 03_crash_and_failover {} {
}
}
03_test_slaves_replication
03_crash_and_failover
03_test_slaves_replication
02_test_slaves_replication
02_crash_and_failover
02_test_slaves_replication
test "Kill a slave instance" {
foreach_redis_id id {
@ -58,8 +59,8 @@ test "Kill a slave instance" {
}
}
03_crash_and_failover
03_test_slaves_replication
02_crash_and_failover
02_test_slaves_replication
test "Wait for failover to end" {
set inprogress 1
@ -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
# if the failover finished.
03_test_slaves_replication
02_test_slaves_replication