From 58cb3491ae3a29b42ec32375012afe8bcfcbe089 Mon Sep 17 00:00:00 2001 From: Guillaume Tardif Date: Tue, 1 Sep 2020 09:24:16 +0200 Subject: [PATCH] =?UTF-8?q?Wait=20only=20for=20the=20first=20=E2=80=9CDELE?= =?UTF-8?q?TE=5FCOMPLETE=E2=80=9D=20line=20when=20running=20`docker=20comp?= =?UTF-8?q?ose=20down`=20(~4=20secs,=20instead=20of=20waiting=208-9=20mins?= =?UTF-8?q?=20for=20the=20entire=20aws=20stack=20to=20be=20deleted),=20and?= =?UTF-8?q?=20let=20aws=20fully=20delete=20stack=20async.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Guillaume Tardif --- tests/ecs-e2e/e2e-ecs_test.go | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/tests/ecs-e2e/e2e-ecs_test.go b/tests/ecs-e2e/e2e-ecs_test.go index fea87c15e..95f5ab620 100644 --- a/tests/ecs-e2e/e2e-ecs_test.go +++ b/tests/ecs-e2e/e2e-ecs_test.go @@ -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)) }) }