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

Merge pull request #25237 from LK4D4/inc_reconcil_timeout

integration: drain node before stop in TestApiSwarmForceNewCluster
This commit is contained in:
Brian Goff 2016-07-29 15:05:16 -04:00 committed by GitHub
commit 8841f530a1

View file

@ -754,9 +754,14 @@ func (s *DockerSwarmSuite) TestApiSwarmForceNewCluster(c *check.C) {
id := d1.createService(c, simpleTestService, setInstances(instances))
waitAndAssert(c, defaultReconciliationTimeout, reducedCheck(sumAsIntegers, d1.checkActiveContainerCount, d2.checkActiveContainerCount), checker.Equals, instances)
c.Assert(d2.Stop(), checker.IsNil)
// drain d2, all containers should move to d1
d1.updateNode(c, d2.NodeID, func(n *swarm.Node) {
n.Spec.Availability = swarm.NodeAvailabilityDrain
})
waitAndAssert(c, defaultReconciliationTimeout, d1.checkActiveContainerCount, checker.Equals, instances)
waitAndAssert(c, defaultReconciliationTimeout, d2.checkActiveContainerCount, checker.Equals, 0)
time.Sleep(5 * time.Second)
c.Assert(d2.Stop(), checker.IsNil)
c.Assert(d1.Init(swarm.InitRequest{
ForceNewCluster: true,