mirror of
https://github.com/status-im/consul.git
synced 2025-02-24 11:28:40 +00:00
Unit test that calls revokeLeadership twice to make sure its idempotent
This commit is contained in:
parent
f59abcc394
commit
907b97b7f2
@ -761,3 +761,22 @@ func TestServer_TLSToFullVerify(t *testing.T) {
|
||||
t.Fatalf("bad: %v", success)
|
||||
}
|
||||
}
|
||||
|
||||
func TestServer_RevokeLeadershipIdempotent(t *testing.T) {
|
||||
t.Parallel()
|
||||
dir1, s1 := testServer(t)
|
||||
defer os.RemoveAll(dir1)
|
||||
defer s1.Shutdown()
|
||||
|
||||
|
||||
testrpc.WaitForLeader(t, s1.RPC, "dc1")
|
||||
|
||||
err:= s1.revokeLeadership()
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
err = s1.revokeLeadership()
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user