diff --git a/raft_test.go b/raft_test.go index cdafc8191..a5101dfa3 100644 --- a/raft_test.go +++ b/raft_test.go @@ -2379,6 +2379,7 @@ func TestRaft_RemovedFollower_Vote(t *testing.T) { if configuration := c.getConfiguration(followers[1]); len(configuration.Servers) != 2 { t.Fatalf("too many peers") } + waitforState(followerRemoved, Follower) // The removed node should be still in Follower state require.Equal(t, Follower, followerRemoved.getState()) @@ -2418,8 +2419,8 @@ func TestRaft_RemovedFollower_Vote(t *testing.T) { func waitforState(follower *Raft, state RaftState) { count := 0 - for follower.getState() != state && count < 1000 { + for follower.getState() != state && count < 5000 { count++ - time.Sleep(1 * time.Millisecond) + time.Sleep(10 * time.Millisecond) } }