1
0
Fork 0
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:
Brian Goff 2015-09-28 22:09:04 -04:00
parent b0dc11127e
commit 9077c89689

View file

@ -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")
}