Skip to content

Commit

Permalink
Merge pull request moby#21337 from yongtang/21247-TestRunAttachFailed…
Browse files Browse the repository at this point in the history
…NoLeak

Flaky test: TestRunAttachFailedNoLeak (moby#21247)
  • Loading branch information
aaronlehmann committed Apr 13, 2016
2 parents f3dcc1c + 2d03c54 commit fa4fea3
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions integration-cli/docker_cli_run_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4211,8 +4211,11 @@ func (s *DockerSuite) TestRunAttachFailedNoLeak(c *check.C) {
// Wait until container is fully up and running
c.Assert(waitRun("test"), check.IsNil)

out, _, err := dockerCmdWithError("run", "-p", "8000:8000", "busybox", "true")
c.Assert(err, checker.NotNil)
out, _, err := dockerCmdWithError("run", "--name=fail", "-p", "8000:8000", "busybox", "true")
// We will need the following `inspect` to diagnose the issue if test fails (#21247)
out1, err1 := dockerCmd(c, "inspect", "--format", "{{json .State}}", "test")
out2, err2 := dockerCmd(c, "inspect", "--format", "{{json .State}}", "fail")
c.Assert(err, checker.NotNil, check.Commentf("Command should have failed but succeeded with: %s\nContainer 'test' [%+v]: %s\nContainer 'fail' [%+v]: %s", out, err1, out1, err2, out2))
// check for windows error as well
// TODO Windows Post TP5. Fix the error message string
c.Assert(strings.Contains(string(out), "port is already allocated") ||
Expand Down

0 comments on commit fa4fea3

Please sign in to comment.