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:
commit
5d65ba4ca7
1 changed files with 13 additions and 5 deletions
|
@ -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,
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue