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

Merge pull request #25085 from aaronlehmann/restart-delay-integration-tests

Specify a lower restart delay for swarm integration tests
This commit is contained in:
Brian Goff 2016-07-26 22:18:28 -04:00 committed by GitHub
commit 5d65ba4ca7

View file

@ -757,14 +757,18 @@ func (s *DockerSwarmSuite) TestApiSwarmForceNewCluster(c *check.C) {
} }
func simpleTestService(s *swarm.Service) { func simpleTestService(s *swarm.Service) {
var ureplicas uint64 ureplicas := uint64(1)
ureplicas = 1 restartDelay := time.Duration(100 * time.Millisecond)
s.Spec = swarm.ServiceSpec{ s.Spec = swarm.ServiceSpec{
TaskTemplate: swarm.TaskSpec{ TaskTemplate: swarm.TaskSpec{
ContainerSpec: swarm.ContainerSpec{ ContainerSpec: swarm.ContainerSpec{
Image: "busybox:latest", Image: "busybox:latest",
Command: []string{"/bin/top"}, Command: []string{"/bin/top"},
}, },
RestartPolicy: &swarm.RestartPolicy{
Delay: &restartDelay,
},
}, },
Mode: swarm.ServiceMode{ Mode: swarm.ServiceMode{
Replicated: &swarm.ReplicatedService{ Replicated: &swarm.ReplicatedService{
@ -776,14 +780,18 @@ func simpleTestService(s *swarm.Service) {
} }
func serviceForUpdate(s *swarm.Service) { func serviceForUpdate(s *swarm.Service) {
var ureplicas uint64 ureplicas := uint64(1)
ureplicas = 1 restartDelay := time.Duration(100 * time.Millisecond)
s.Spec = swarm.ServiceSpec{ s.Spec = swarm.ServiceSpec{
TaskTemplate: swarm.TaskSpec{ TaskTemplate: swarm.TaskSpec{
ContainerSpec: swarm.ContainerSpec{ ContainerSpec: swarm.ContainerSpec{
Image: "busybox:latest", Image: "busybox:latest",
Command: []string{"/bin/top"}, Command: []string{"/bin/top"},
}, },
RestartPolicy: &swarm.RestartPolicy{
Delay: &restartDelay,
},
}, },
Mode: swarm.ServiceMode{ Mode: swarm.ServiceMode{
Replicated: &swarm.ReplicatedService{ Replicated: &swarm.ReplicatedService{
@ -792,7 +800,7 @@ func serviceForUpdate(s *swarm.Service) {
}, },
UpdateConfig: &swarm.UpdateConfig{ UpdateConfig: &swarm.UpdateConfig{
Parallelism: 2, Parallelism: 2,
Delay: 8 * time.Second, Delay: 4 * time.Second,
FailureAction: swarm.UpdateFailureActionContinue, FailureAction: swarm.UpdateFailureActionContinue,
}, },
} }