Skip to content

Commit

Permalink
add a revoke leadership test
Browse files Browse the repository at this point in the history
  • Loading branch information
dadgar committed Feb 20, 2018
1 parent f1877e3 commit e09d14e
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions nomad/leader_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import (
"github.com/hashicorp/nomad/nomad/structs"
"github.com/hashicorp/nomad/testutil"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
)

func TestLeader_LeftServer(t *testing.T) {
Expand Down Expand Up @@ -978,3 +979,13 @@ func TestLeader_RollRaftServer(t *testing.T) {
})
}
}

func TestLeader_RevokeLeadership_MultipleTimes(t *testing.T) {
s1 := testServer(t, nil)
defer s1.Shutdown()
testutil.WaitForLeader(t, s1.RPC)

require.Nil(t, s1.revokeLeadership())
require.Nil(t, s1.revokeLeadership())
require.Nil(t, s1.revokeLeadership())
}

0 comments on commit e09d14e

Please sign in to comment.