Browse code

fix docker integration-cli restart test race

Docker-DCO-1.1-Signed-off-by: Erik Hollensbe <github@hollensbe.org> (github: erikh)

Erik Hollensbe authored on 2014/07/29 15:46:14
Showing 1 changed files
... ...
@@ -4,6 +4,7 @@ import (
4 4
 	"os/exec"
5 5
 	"strings"
6 6
 	"testing"
7
+	"time"
7 8
 )
8 9
 
9 10
 func TestDockerRestartStoppedContainer(t *testing.T) {
... ...
@@ -49,6 +50,8 @@ func TestDockerRestartRunningContainer(t *testing.T) {
49 49
 
50 50
 	cleanedContainerID := stripTrailingCharacters(out)
51 51
 
52
+	time.Sleep(1 * time.Second)
53
+
52 54
 	runCmd = exec.Command(dockerBinary, "logs", cleanedContainerID)
53 55
 	out, _, err = runCommandWithOutput(runCmd)
54 56
 	errorOut(err, t, out)
... ...
@@ -65,6 +68,8 @@ func TestDockerRestartRunningContainer(t *testing.T) {
65 65
 	out, _, err = runCommandWithOutput(runCmd)
66 66
 	errorOut(err, t, out)
67 67
 
68
+	time.Sleep(1 * time.Second)
69
+
68 70
 	if out != "foobar\nfoobar\n" {
69 71
 		t.Errorf("container should've printed 'foobar' twice")
70 72
 	}