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>
| ... | ... |
@@ -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 {
|