mirror of
https://github.com/clearlinux/docker.git
synced 2026-09-04 20:51:44 +00:00
integration-cli: remove timeout dependency on TestEventsUntag
TestEventsUntag requires a `timeout` command which does not exist on OS X or Windows (in fact, windows has a totally different timeout program and this test was accidentally using it). - Created runCommandWithOutputForDuration. This entirely replaces runDockerCommandWithTimeout and removes dependency to `timeout` command. - Made runDockerCommandWithTimeout reuse runDockerCommandForDuration. TestEventsUntag works now on Windows. Signed-off-by: Ahmet Alp Balkan <ahmetalpbalkan@gmail.com>
This commit is contained in:
@@ -15,8 +15,11 @@ func TestEventsUntag(t *testing.T) {
|
||||
dockerCmd(t, "tag", image, "utest:tag2")
|
||||
dockerCmd(t, "rmi", "utest:tag1")
|
||||
dockerCmd(t, "rmi", "utest:tag2")
|
||||
eventsCmd := exec.Command("timeout", "0.2", dockerBinary, "events", "--since=1")
|
||||
out, _, _ := runCommandWithOutput(eventsCmd)
|
||||
eventsCmd := exec.Command(dockerBinary, "events", "--since=1")
|
||||
out, exitCode, _, err := runCommandWithOutputForDuration(eventsCmd, time.Duration(time.Millisecond*200))
|
||||
if exitCode != 0 || err != nil {
|
||||
t.Fatalf("Failed to get events - exit code %d: %s", exitCode, err)
|
||||
}
|
||||
events := strings.Split(out, "\n")
|
||||
nEvents := len(events)
|
||||
// The last element after the split above will be an empty string, so we
|
||||
|
||||
Reference in New Issue
Block a user