Skip to content

Commit

Permalink
integration: drain node before stop in TestApiSwarmForceNewCluster
Browse files Browse the repository at this point in the history
It's too long to wait for reschedule.

Signed-off-by: Alexander Morozov <[email protected]>
  • Loading branch information
LK4D4 committed Jul 29, 2016
1 parent 10fcd30 commit 307b7b0
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions integration-cli/docker_api_swarm_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 307b7b0

Please sign in to comment.