From e5b7f61f090bfc951590dd5dad3f6bb1ce3888ba Mon Sep 17 00:00:00 2001 From: Arnaud Porterie Date: Fri, 12 Jun 2015 10:45:42 -0700 Subject: [PATCH] Replace "sleep" by "top" in test implementation Eliminate any chance of race condition by replacing a call to sleep by a call to top, and rely on test cleanup logic to have it exit cleanly. Signed-off-by: Arnaud Porterie --- integration-cli/docker_api_containers_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/integration-cli/docker_api_containers_test.go b/integration-cli/docker_api_containers_test.go index 9f587a80a5..baee2e57c1 100644 --- a/integration-cli/docker_api_containers_test.go +++ b/integration-cli/docker_api_containers_test.go @@ -94,7 +94,7 @@ type containerPs struct { func (s *DockerSuite) TestContainerPsOmitFields(c *check.C) { name := "pstest" port := 80 - runCmd := exec.Command(dockerBinary, "run", "-d", "--name", name, "--expose", strconv.Itoa(port), "busybox", "sleep", "5") + runCmd := exec.Command(dockerBinary, "run", "-d", "--name", name, "--expose", strconv.Itoa(port), "busybox", "top") _, err := runCommand(runCmd) c.Assert(err, check.IsNil)