瀏覽代碼

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 <[email protected]>
Guillaume Tardif 5 年之前
父節點
當前提交
58cb3491ae
共有 1 個文件被更改,包括 11 次插入1 次删除
  1. 11 1
      tests/ecs-e2e/e2e-ecs_test.go

+ 11 - 1
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))
 	})
 }