Skip to content

Commit

Permalink
more stability
Browse files Browse the repository at this point in the history
Signed-off-by: nolouch <nolouch@gmail.com>
  • Loading branch information
nolouch committed Dec 7, 2018
1 parent 2f5ec51 commit 95890c2
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion tests/integrations/raftstore/test_conf_change.rs
Expand Up @@ -603,7 +603,14 @@ fn test_transfer_leader_safe<T: Simulator>(cluster: &mut Cluster<T>) {
// Test transfer leader after a safe duration.
thread::sleep(cfg.raft_store.raft_reject_transfer_leader_duration.into());
cluster.transfer_leader(region_id, new_peer(3, 3));
cluster.reset_leader_of_region(region_id);
// Retry for more stability
for _ in 0..20 {
cluster.reset_leader_of_region(region_id);
if cluster.leader_of_region(region_id) != Some(new_peer(3, 3)) {
continue;
}
break;
}
assert_eq!(cluster.leader_of_region(region_id).unwrap().get_id(), 3);
}

Expand Down

0 comments on commit 95890c2

Please sign in to comment.