1
0
mirror of https://github.com/moby/moby.git synced 2025-07-29 07:21:35 +03:00

fix #12188 integration-cli: tests using "sleep" can timeout too early - change to "top" instead

Signed-off-by: Todd Whiteman <todd.whiteman@joyent.com>
This commit is contained in:
Todd Whiteman
2015-04-08 16:32:45 -07:00
parent 2052d01b1e
commit 42d47c3136
6 changed files with 38 additions and 50 deletions

View File

@ -19,7 +19,7 @@ import (
func TestExec(t *testing.T) {
defer deleteAllContainers()
runCmd := exec.Command(dockerBinary, "run", "-d", "--name", "testing", "busybox", "sh", "-c", "echo test > /tmp/file && sleep 100")
runCmd := exec.Command(dockerBinary, "run", "-d", "--name", "testing", "busybox", "sh", "-c", "echo test > /tmp/file && top")
if out, _, _, err := runCommandWithStdoutStderr(runCmd); err != nil {
t.Fatal(out, err)
}
@ -82,7 +82,7 @@ func TestExecInteractiveStdinClose(t *testing.T) {
func TestExecInteractive(t *testing.T) {
defer deleteAllContainers()
runCmd := exec.Command(dockerBinary, "run", "-d", "--name", "testing", "busybox", "sh", "-c", "echo test > /tmp/file && sleep 100")
runCmd := exec.Command(dockerBinary, "run", "-d", "--name", "testing", "busybox", "sh", "-c", "echo test > /tmp/file && top")
if out, _, _, err := runCommandWithStdoutStderr(runCmd); err != nil {
t.Fatal(out, err)
}
@ -500,12 +500,12 @@ func TestLinksPingLinkedContainersOnRename(t *testing.T) {
defer deleteAllContainers()
var out string
out, _, _ = dockerCmd(t, "run", "-d", "--name", "container1", "busybox", "sleep", "10")
out, _, _ = dockerCmd(t, "run", "-d", "--name", "container1", "busybox", "top")
idA := strings.TrimSpace(out)
if idA == "" {
t.Fatal(out, "id should not be nil")
}
out, _, _ = dockerCmd(t, "run", "-d", "--link", "container1:alias1", "--name", "container2", "busybox", "sleep", "10")
out, _, _ = dockerCmd(t, "run", "-d", "--link", "container1:alias1", "--name", "container2", "busybox", "top")
idB := strings.TrimSpace(out)
if idB == "" {
t.Fatal(out, "id should not be nil")