mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
Slightly speed up TestAPISwarmNodeDrainPause
Looks like we don't need that many replicas, to test the behavior, so let's start a few less. Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
parent
ad2765b35e
commit
ebdc9a3afc
1 changed files with 3 additions and 5 deletions
|
@ -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
|
time.Sleep(1 * time.Second) // make sure all daemons are ready to accept tasks
|
||||||
|
|
||||||
// start a service, expect balanced distribution
|
// start a service, expect balanced distribution
|
||||||
instances := 8
|
instances := 2
|
||||||
id := d1.CreateService(c, simpleTestService, setInstances(instances))
|
id := d1.CreateService(c, simpleTestService, setInstances(instances))
|
||||||
|
|
||||||
waitAndAssert(c, defaultReconciliationTimeout, d1.CheckActiveContainerCount, checker.GreaterThan, 0)
|
waitAndAssert(c, defaultReconciliationTimeout, d1.CheckActiveContainerCount, checker.GreaterThan, 0)
|
||||||
|
@ -100,10 +100,9 @@ func (s *DockerSwarmSuite) TestAPISwarmNodeDrainPause(c *check.C) {
|
||||||
|
|
||||||
instances = 1
|
instances = 1
|
||||||
d1.UpdateService(c, d1.GetService(c, id), setInstances(instances))
|
d1.UpdateService(c, d1.GetService(c, id), setInstances(instances))
|
||||||
|
|
||||||
waitAndAssert(c, defaultReconciliationTimeout*2, reducedCheck(sumAsIntegers, d1.CheckActiveContainerCount, d2.CheckActiveContainerCount), checker.Equals, 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))
|
d1.UpdateService(c, d1.GetService(c, id), setInstances(instances))
|
||||||
|
|
||||||
// drained node first so we don't get any old containers
|
// 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
|
n.Spec.Availability = swarm.NodeAvailabilityPause
|
||||||
})
|
})
|
||||||
|
|
||||||
instances = 14
|
instances = 4
|
||||||
d1.UpdateService(c, d1.GetService(c, id), setInstances(instances))
|
d1.UpdateService(c, d1.GetService(c, id), setInstances(instances))
|
||||||
|
|
||||||
waitAndAssert(c, defaultReconciliationTimeout, d1.CheckActiveContainerCount, checker.Equals, instances-d2ContainerCount)
|
waitAndAssert(c, defaultReconciliationTimeout, d1.CheckActiveContainerCount, checker.Equals, instances-d2ContainerCount)
|
||||||
waitAndAssert(c, defaultReconciliationTimeout, d2.CheckActiveContainerCount, checker.Equals, d2ContainerCount)
|
waitAndAssert(c, defaultReconciliationTimeout, d2.CheckActiveContainerCount, checker.Equals, d2ContainerCount)
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue