Test autopilots start/stop idempotency

This commit is contained in:
Alex Dadgar 2018-02-21 10:19:30 -08:00
parent 4d99696f02
commit 535842004c
1 changed files with 14 additions and 0 deletions

View File

@ -11,6 +11,20 @@ import (
"github.com/hashicorp/serf/serf"
)
func TestAutopilot_IdempotentShutdown(t *testing.T) {
dir1, s1 := testServerWithConfig(t, nil)
defer os.RemoveAll(dir1)
defer s1.Shutdown()
retry.Run(t, func(r *retry.R) { r.Check(waitForLeader(s1)) })
s1.autopilot.Start()
s1.autopilot.Start()
s1.autopilot.Start()
s1.autopilot.Stop()
s1.autopilot.Stop()
s1.autopilot.Stop()
}
func TestAutopilot_CleanupDeadServer(t *testing.T) {
t.Parallel()
for i := 1; i <= 3; i++ {