diff --git a/integration-cli/docker_api_swarm_test.go b/integration-cli/docker_api_swarm_test.go index 8f8b8eb138..adb3885f35 100644 --- a/integration-cli/docker_api_swarm_test.go +++ b/integration-cli/docker_api_swarm_test.go @@ -370,8 +370,12 @@ func (s *DockerSwarmSuite) TestAPISwarmRaftQuorum(c *check.C) { cli, err := d1.NewClient() c.Assert(err, checker.IsNil) defer cli.Close() - _, err = cli.ServiceCreate(context.Background(), service.Spec, types.ServiceCreateOptions{}) - c.Assert(err.Error(), checker.Contains, "deadline exceeded") + + // d1 will eventually step down from leader because there is no longer an active quorum, wait for that to happen + waitAndAssert(c, defaultReconciliationTimeout, func(c *check.C) (interface{}, check.CommentInterface) { + _, err = cli.ServiceCreate(context.Background(), service.Spec, types.ServiceCreateOptions{}) + return err.Error(), nil + }, checker.Contains, "Make sure more than half of the managers are online.") d2.Start(c)