mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
Make sure test container is running before exec
Fixes race in TestExecStartFails Signed-off-by: Brian Goff <cpuguy83@gmail.com>
This commit is contained in:
parent
b0dc11127e
commit
9077c89689
1 changed files with 5 additions and 4 deletions
|
@ -15,6 +15,7 @@ import (
|
|||
"sync"
|
||||
"time"
|
||||
|
||||
"github.com/docker/docker/pkg/integration/checker"
|
||||
"github.com/go-check/check"
|
||||
)
|
||||
|
||||
|
@ -616,9 +617,9 @@ func (s *DockerSuite) TestExecStartFails(c *check.C) {
|
|||
testRequires(c, DaemonIsLinux)
|
||||
name := "exec-15750"
|
||||
dockerCmd(c, "run", "-d", "--name", name, "busybox", "top")
|
||||
c.Assert(waitRun(name), check.IsNil)
|
||||
|
||||
_, errmsg, status := dockerCmdWithStdoutStderr(nil, "exec", name, "no-such-cmd")
|
||||
if status == 255 && !strings.Contains(errmsg, "executable file not found") {
|
||||
c.Fatal("exec error message not received. The daemon might had crashed")
|
||||
}
|
||||
out, _, err := dockerCmdWithError("exec", name, "no-such-cmd")
|
||||
c.Assert(err, check.NotNil, check.Commentf(out))
|
||||
c.Assert(out, checker.Contains, "executable file not found")
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue