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

Fix flaky TestStackRemove test.

Signed-off-by: Daniel Nephin <dnephin@docker.com>
This commit is contained in:
Daniel Nephin 2017-03-24 15:31:08 -04:00
parent b86efd2707
commit 73e6135458
2 changed files with 18 additions and 11 deletions

View file

@ -11,6 +11,7 @@ import (
"github.com/docker/docker/api/types/swarm" "github.com/docker/docker/api/types/swarm"
"github.com/docker/docker/integration-cli/checker" "github.com/docker/docker/integration-cli/checker"
icmd "github.com/docker/docker/pkg/testutil/cmd"
"github.com/go-check/check" "github.com/go-check/check"
) )
@ -111,18 +112,24 @@ func (s *DockerSwarmSuite) TestStackRemove(c *check.C) {
"--compose-file", "fixtures/deploy/remove.yaml", "--compose-file", "fixtures/deploy/remove.yaml",
stackName, stackName,
} }
out, err := d.Cmd(stackArgs...) result := icmd.RunCmd(d.Command(stackArgs...))
c.Assert(err, checker.IsNil, check.Commentf(out)) result.Assert(c, icmd.Expected{
Err: icmd.None,
Out: "Creating service testdeploy_web",
})
out, err = d.Cmd("stack", "ps", stackName) result = icmd.RunCmd(d.Command("service", "ls"))
c.Assert(err, checker.IsNil) result.Assert(c, icmd.Success)
c.Assert(strings.Split(strings.TrimSpace(out), "\n"), checker.HasLen, 2) c.Assert(
strings.Split(strings.TrimSpace(result.Stdout()), "\n"),
checker.HasLen, 2)
out, err = d.Cmd("stack", "rm", stackName) result = icmd.RunCmd(d.Command("stack", "rm", stackName))
c.Assert(err, checker.IsNil, check.Commentf(out)) result.Assert(c, icmd.Success)
c.Assert(out, checker.Contains, "Removing service testdeploy_web") stderr := result.Stderr()
c.Assert(out, checker.Contains, "Removing network testdeploy_default") c.Assert(stderr, checker.Contains, "Removing service testdeploy_web")
c.Assert(out, checker.Contains, "Removing secret testdeploy_special") c.Assert(stderr, checker.Contains, "Removing network testdeploy_default")
c.Assert(stderr, checker.Contains, "Removing secret testdeploy_special")
} }
type sortSecrets []swarm.SecretReference type sortSecrets []swarm.SecretReference

View file

@ -2,7 +2,7 @@
version: "3.1" version: "3.1"
services: services:
web: web:
image: busybox@sha256:e4f93f6ed15a0cdd342f5aae387886fba0ab98af0a102da6276eaf24d6e6ade0 image: busybox:latest
command: top command: top
secrets: secrets:
- special - special