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

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

View File

@ -14,7 +14,7 @@ func TestPause(t *testing.T) {
name := "testeventpause"
out, _, _ := dockerCmd(t, "images", "-q")
image := strings.Split(out, "\n")[0]
dockerCmd(t, "run", "-d", "--name", name, image, "sleep", "2")
dockerCmd(t, "run", "-d", "--name", name, image, "top")
dockerCmd(t, "pause", name)
pausedContainers, err := getSliceOfPausedContainers()
@ -44,11 +44,6 @@ func TestPause(t *testing.T) {
t.Fatalf("event should be unpause, not %#v", unpauseEvent)
}
waitCmd := exec.Command(dockerBinary, "wait", name)
if waitOut, _, err := runCommandWithOutput(waitCmd); err != nil {
t.Fatalf("error thrown while waiting for container: %s, %v", waitOut, err)
}
logDone("pause - pause/unpause is logged")
}
@ -63,7 +58,7 @@ func TestPauseMultipleContainers(t *testing.T) {
out, _, _ := dockerCmd(t, "images", "-q")
image := strings.Split(out, "\n")[0]
for _, name := range containers {
dockerCmd(t, "run", "-d", "--name", name, image, "sleep", "2")
dockerCmd(t, "run", "-d", "--name", name, image, "top")
}
dockerCmd(t, append([]string{"pause"}, containers...)...)
pausedContainers, err := getSliceOfPausedContainers()
@ -101,12 +96,5 @@ func TestPauseMultipleContainers(t *testing.T) {
}
}
for _, name := range containers {
waitCmd := exec.Command(dockerBinary, "wait", name)
if waitOut, _, err := runCommandWithOutput(waitCmd); err != nil {
t.Fatalf("error thrown while waiting for container: %s, %v", waitOut, err)
}
}
logDone("pause - multi pause/unpause is logged")
}