Browse code

Fix flaky test TestStatsAllNewContainersAdded

Wait the new created container for running and then check if it
is in the docker stats to avoid flaky test.

Signed-off-by: Lei Jitang <leijitang@huawei.com>

Lei Jitang authored on 2016/01/08 18:02:08
Showing 1 changed files
... ...
@@ -118,6 +118,7 @@ func (s *DockerSuite) TestStatsAllNewContainersAdded(c *check.C) {
118 118
 	}()
119 119
 
120 120
 	out, _ := dockerCmd(c, "run", "-d", "busybox", "top")
121
+	c.Assert(waitRun(strings.TrimSpace(out)), check.IsNil)
121 122
 	id <- strings.TrimSpace(out)[:12]
122 123
 
123 124
 	select {