diff --git a/raft_test.go b/raft_test.go index 1e7a2452d..1fee1adb7 100644 --- a/raft_test.go +++ b/raft_test.go @@ -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 diff --git a/testing.go b/testing.go index 1dd61b94c..9620311da 100644 --- a/testing.go +++ b/testing.go @@ -165,7 +165,7 @@ func newTestLogger(t *testing.T) hclog.Logger { // the logs only appear when a test fails. func newTestLoggerWithPrefix(t *testing.T, prefix string) hclog.Logger { if testing.Verbose() { - return hclog.New(&hclog.LoggerOptions{Name: prefix}) + return hclog.New(&hclog.LoggerOptions{Name: prefix, Level: 2}) } return hclog.New(&hclog.LoggerOptions{