From 5931669343f568114cb209dabf8913be44cd63e8 Mon Sep 17 00:00:00 2001 From: Erik Hollensbe Date: Mon, 28 Jul 2014 23:46:14 -0700 Subject: [PATCH] fix docker integration-cli restart test race Docker-DCO-1.1-Signed-off-by: Erik Hollensbe (github: erikh) --- integration-cli/docker_cli_restart_test.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/integration-cli/docker_cli_restart_test.go b/integration-cli/docker_cli_restart_test.go index c62f108cc7..946a7c7ca7 100644 --- a/integration-cli/docker_cli_restart_test.go +++ b/integration-cli/docker_cli_restart_test.go @@ -4,6 +4,7 @@ import ( "os/exec" "strings" "testing" + "time" ) func TestDockerRestartStoppedContainer(t *testing.T) { @@ -49,6 +50,8 @@ func TestDockerRestartRunningContainer(t *testing.T) { cleanedContainerID := stripTrailingCharacters(out) + time.Sleep(1 * time.Second) + runCmd = exec.Command(dockerBinary, "logs", cleanedContainerID) out, _, err = runCommandWithOutput(runCmd) errorOut(err, t, out) @@ -65,6 +68,8 @@ func TestDockerRestartRunningContainer(t *testing.T) { out, _, err = runCommandWithOutput(runCmd) errorOut(err, t, out) + time.Sleep(1 * time.Second) + if out != "foobar\nfoobar\n" { t.Errorf("container should've printed 'foobar' twice") }