mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
integration: drain node before stop in TestApiSwarmForceNewCluster
It's too long to wait for reschedule. Signed-off-by: Alexander Morozov <lk4d4@docker.com>
This commit is contained in:
parent
10fcd30a90
commit
307b7b0d15
1 changed files with 7 additions and 2 deletions
|
@ -754,9 +754,14 @@ func (s *DockerSwarmSuite) TestApiSwarmForceNewCluster(c *check.C) {
|
||||||
id := d1.createService(c, simpleTestService, setInstances(instances))
|
id := d1.createService(c, simpleTestService, setInstances(instances))
|
||||||
waitAndAssert(c, defaultReconciliationTimeout, reducedCheck(sumAsIntegers, d1.checkActiveContainerCount, d2.checkActiveContainerCount), checker.Equals, 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{
|
c.Assert(d1.Init(swarm.InitRequest{
|
||||||
ForceNewCluster: true,
|
ForceNewCluster: true,
|
||||||
|
|
Loading…
Reference in a new issue