Skip to content

Commit

Permalink
add wait loop to test
Browse files Browse the repository at this point in the history
  • Loading branch information
dhiaayachi committed Sep 22, 2021
1 parent 702e286 commit 9f012d8
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions raft_test.go
Expand Up @@ -760,6 +760,11 @@ func TestRaft_RemovedFollower_Vote(t *testing.T) {
time.Sleep(c.propagateTimeout)

// wait for the remaining follower to trigger an election
count := 0
for follower.getState() != Candidate && count < 1000 {
count++
time.Sleep(1 * time.Millisecond)
}
require.Equal(t, Candidate, follower.getState())

// send a vote request from the removed follower to the Candidate follower
Expand Down

0 comments on commit 9f012d8

Please sign in to comment.