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-09 10:46:57 -07:00
parent 2052d01b1e
commit 42d47c3136
6 changed files with 38 additions and 50 deletions
+2 -14
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")
}