1
0
Fork 0
mirror of https://github.com/moby/moby.git synced 2022-11-09 12:21:53 -05:00
moby--moby/integration-cli/docker_cli_update_test.go
Sebastiaan van Stijn f43683d60d Fix flaky TestUpdateRestartPolicy on Windows
Add another 30 seconds, because it still fails sometimes :'(

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2016-03-14 12:49:24 +01:00

31 lines
814 B
Go

package main
import (
"strings"
"time"
"github.com/docker/docker/pkg/integration/checker"
"github.com/go-check/check"
)
func (s *DockerSuite) TestUpdateRestartPolicy(c *check.C) {
out, _ := dockerCmd(c, "run", "-d", "--restart=on-failure:3", "busybox", "sh", "-c", "sleep 1 && false")
timeout := 60 * time.Second
if daemonPlatform == "windows" {
timeout = 180 * time.Second
}
id := strings.TrimSpace(string(out))
// update restart policy to on-failure:5
dockerCmd(c, "update", "--restart=on-failure:5", id)
err := waitExited(id, timeout)
c.Assert(err, checker.IsNil)
count := inspectField(c, id, "RestartCount")
c.Assert(count, checker.Equals, "5")
maximumRetryCount := inspectField(c, id, "HostConfig.RestartPolicy.MaximumRetryCount")
c.Assert(maximumRetryCount, checker.Equals, "5")
}