mirror of
https://github.com/docker/cli.git
synced 2026-01-18 08:21:31 +03:00
Merge pull request #7298 from erikh/fix_cli_restart_test
fix docker integration-cli restart test race Upstream-commit: 3100afa0e19f9fe36a6de304212998e357c1f3e0 Component: engine
This commit is contained in:
@@ -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")
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user