From 71d6e71cff4122a987a4655723d50a296916f523 Mon Sep 17 00:00:00 2001 From: Lei Jitang Date: Fri, 8 Jan 2016 17:02:08 +0800 Subject: [PATCH] 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 --- integration-cli/docker_cli_stats_test.go | 1 + 1 file changed, 1 insertion(+) diff --git a/integration-cli/docker_cli_stats_test.go b/integration-cli/docker_cli_stats_test.go index 6b866e14f8..1258c66576 100644 --- a/integration-cli/docker_cli_stats_test.go +++ b/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 {