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

Merge pull request #38553 from thaJeztah/faster_api_node_drain_pause

Slightly speed up TestAPISwarmNodeDrainPause
This commit is contained in:
Brian Goff 2019-01-15 13:49:28 -08:00 committed by GitHub
commit 64fd09bd29
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -79,7 +79,7 @@ func (s *DockerSwarmSuite) TestAPISwarmNodeDrainPause(c *check.C) {
time.Sleep(1 * time.Second) // make sure all daemons are ready to accept tasks
// start a service, expect balanced distribution
instances := 8
instances := 2
id := d1.CreateService(c, simpleTestService, setInstances(instances))
waitAndAssert(c, defaultReconciliationTimeout, d1.CheckActiveContainerCount, checker.GreaterThan, 0)
@ -100,10 +100,9 @@ func (s *DockerSwarmSuite) TestAPISwarmNodeDrainPause(c *check.C) {
instances = 1
d1.UpdateService(c, d1.GetService(c, id), setInstances(instances))
waitAndAssert(c, defaultReconciliationTimeout*2, reducedCheck(sumAsIntegers, d1.CheckActiveContainerCount, d2.CheckActiveContainerCount), checker.Equals, instances)
instances = 8
instances = 2
d1.UpdateService(c, d1.GetService(c, id), setInstances(instances))
// drained node first so we don't get any old containers
@ -118,9 +117,8 @@ func (s *DockerSwarmSuite) TestAPISwarmNodeDrainPause(c *check.C) {
n.Spec.Availability = swarm.NodeAvailabilityPause
})
instances = 14
instances = 4
d1.UpdateService(c, d1.GetService(c, id), setInstances(instances))
waitAndAssert(c, defaultReconciliationTimeout, d1.CheckActiveContainerCount, checker.Equals, instances-d2ContainerCount)
waitAndAssert(c, defaultReconciliationTimeout, d2.CheckActiveContainerCount, checker.Equals, d2ContainerCount)