Wait only for the first “DELETE_COMPLETE” line when running `docker compose down` (~4 secs, instead of waiting 8-9 mins for the entire aws stack to be deleted), and let aws fully delete stack async.

Signed-off-by: Guillaume Tardif <guillaume.tardif@docker.com>
This commit is contained in:
Guillaume Tardif 2020-09-01 09:24:16 +02:00
parent b9153961ab
commit 58cb3491ae
1 changed files with 11 additions and 1 deletions

View File

@ -116,7 +116,17 @@ func TestCompose(t *testing.T) {
})
t.Run("compose down", func(t *testing.T) {
c.RunDockerCmd("compose", "down", "--project-name", stack, "-f", "../composefiles/nginx.yaml")
cmd := c.NewDockerCmd("compose", "down", "--project-name", stack)
res := icmd.StartCmd(cmd)
checkUp := func(t poll.LogT) poll.Result {
out := res.Stdout()
if !strings.Contains(out, "DELETE_COMPLETE") {
return poll.Continue("current status \n%s\n", out)
}
return poll.Success()
}
poll.WaitOn(t, checkUp, poll.WithDelay(2*time.Second), poll.WithTimeout(60*time.Second))
})
}