Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Heartbeat improvements and handling failures during establishing leadership #3890

Merged
merged 9 commits into from
Mar 12, 2018
Prev Previous commit
Next Next commit
Fix flaky test
  • Loading branch information
dadgar committed Feb 21, 2018
commit 08353e87230a136a6448ba5973e38d350abd48b4
6 changes: 4 additions & 2 deletions nomad/heartbeat_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -271,9 +271,11 @@ func TestHeartbeat_Server_HeartbeatTTL_Failover(t *testing.T) {
leader.Shutdown()

// heartbeatTimers should be cleared on leader shutdown
if len(leader.heartbeatTimers) != 0 {
testutil.WaitForResult(func() (bool, error) {
return len(leader.heartbeatTimers) == 0, nil
}, func(err error) {
t.Fatalf("heartbeat timers should be empty on the shutdown leader")
}
})

// Find the new leader
testutil.WaitForResult(func() (bool, error) {
Expand Down