diff options
author | antirez <antirez@gmail.com> | 2014-06-19 15:56:28 +0200 |
---|---|---|
committer | antirez <antirez@gmail.com> | 2014-06-19 16:10:17 +0200 |
commit | fd2faee5de84a5f5155a3a85a47776b1af72db33 (patch) | |
tree | 99779f4c05526a5feb1e786cf687f01875a25b81 | |
parent | 93ee0f2666dd9c5b805ec0c0f64aa09e1b536d85 (diff) | |
download | redis-fd2faee5de84a5f5155a3a85a47776b1af72db33.tar.gz |
Sentinel test: unit 02, avoid some time related false positives.
-rw-r--r-- | tests/sentinel/tests/02-slaves-reconf.tcl | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/tests/sentinel/tests/02-slaves-reconf.tcl b/tests/sentinel/tests/02-slaves-reconf.tcl index 868bae5ec..fa15d2efd 100644 --- a/tests/sentinel/tests/02-slaves-reconf.tcl +++ b/tests/sentinel/tests/02-slaves-reconf.tcl @@ -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 |