Better checking for LogsFollowGoroutinesWithStdout

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
Upstream-commit: 2805ff1ecee7cd850a08a00ee9448b54beb4032b
Component: engine
This commit is contained in:
Brian Goff
2015-05-21 13:02:16 -04:00
parent f077c776e0
commit 97013d9e36

View File

@ -436,9 +436,11 @@ func (s *DockerSuite) TestLogsFollowGoroutinesWithStdout(c *check.C) {
for {
select {
case <-t:
c.Assert(nroutines, check.Equals, getNGoroutines())
if n := getNGoroutines(); n > nroutines {
c.Fatalf("leaked goroutines: expected less than or equal to %d, got: %d", nroutines, n)
}
default:
if nroutines == getNGoroutines() {
if n := getNGoroutines(); n <= nroutines {
return
}
time.Sleep(200 * time.Millisecond)