Better logging for errors in some tests

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
Upstream-commit: 42df9edc4a6ccfff6869fd14b2128ca3312e99db
Component: engine
This commit is contained in:
Brian Goff
2016-03-24 12:43:04 -04:00
parent 971b432393
commit 44532d43ae
5 changed files with 21 additions and 12 deletions

View File

@ -35,10 +35,12 @@ func (s *DockerSuite) TestWaitBlockedExitZero(c *check.C) {
chWait := make(chan string)
go func() {
chWait <- ""
out, _, _ := runCommandWithOutput(exec.Command(dockerBinary, "wait", containerID))
chWait <- out
}()
<-chWait // make sure the goroutine is started
time.Sleep(100 * time.Millisecond)
dockerCmd(c, "stop", containerID)
@ -84,7 +86,7 @@ func (s *DockerSuite) TestWaitBlockedExitRandom(c *check.C) {
select {
case err := <-chWait:
c.Assert(err, checker.IsNil)
c.Assert(err, checker.IsNil, check.Commentf(waitCmdOut.String()))
status, err := waitCmdOut.ReadString('\n')
c.Assert(err, checker.IsNil)
c.Assert(strings.TrimSpace(status), checker.Equals, "99", check.Commentf("expected exit 99, got %s", status))