1
0
Fork 0
mirror of https://github.com/moby/moby.git synced 2022-11-09 12:21:53 -05:00

Merge pull request #35173 from tophj-ibm/fix-raft-quorum-test

[integration-cli] fix flaky raft test
This commit is contained in:
Yong Tang 2017-10-11 22:23:18 -07:00 committed by GitHub
commit dc74e31bb2

View file

@ -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)