浏览代码

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 9 年之前
父节点
当前提交
71d6e71cff
共有 1 个文件被更改,包括 1 次插入0 次删除
  1. 1 0
      integration-cli/docker_cli_stats_test.go

+ 1 - 0
integration-cli/docker_cli_stats_test.go

@@ -118,6 +118,7 @@ func (s *DockerSuite) TestStatsAllNewContainersAdded(c *check.C) {
 	}()
 
 	out, _ := dockerCmd(c, "run", "-d", "busybox", "top")
+	c.Assert(waitRun(strings.TrimSpace(out)), check.IsNil)
 	id <- strings.TrimSpace(out)[:12]
 
 	select {