fix docker integration-cli restart test race
Docker-DCO-1.1-Signed-off-by: Erik Hollensbe <github@hollensbe.org> (github: erikh)
This commit is contained in:
parent
ac3eecf3db
commit
5931669343
1 changed files with 5 additions and 0 deletions
|
@ -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")
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue