소스 검색

Updated ACI e2e flaky test to avoid failing when https://github.com/docker/desktop-microsoft/issues/49 happens

Signed-off-by: Guillaume Tardif <[email protected]>
Guillaume Tardif 5 년 전
부모
커밋
6ad48b9212
1개의 변경된 파일7개의 추가작업 그리고 5개의 파일을 삭제
  1. 7 5
      tests/aci-e2e/e2e-aci_test.go

+ 7 - 5
tests/aci-e2e/e2e-aci_test.go

@@ -394,7 +394,7 @@ func TestContainerRunAttached(t *testing.T) {
 	t.Run("rm stopped container", func(t *testing.T) {
 		res := c.RunDockerCmd("stop", container)
 		res.Assert(t, icmd.Expected{Out: container})
-		waitForStatus(t, c, container, "Terminated")
+		waitForStatus(t, c, container, "Terminated", "Node Stopped")
 
 		res = c.RunDockerCmd("rm", container)
 		res.Assert(t, icmd.Expected{Out: container})
@@ -664,15 +664,17 @@ func getContainerName(stdout string) string {
 	return strings.TrimSpace(out[len(out)-1])
 }
 
-func waitForStatus(t *testing.T, c *E2eCLI, containerID string, status string) {
+func waitForStatus(t *testing.T, c *E2eCLI, containerID string, statuses ...string) {
 	checkStopped := func(logt poll.LogT) poll.Result {
 		res := c.RunDockerCmd("inspect", containerID)
 		containerInspect, err := ParseContainerInspect(res.Stdout())
 		assert.NilError(t, err)
-		if containerInspect.Status == status {
-			return poll.Success()
+		for _, status := range statuses {
+			if containerInspect.Status == status {
+				return poll.Success()
+			}
 		}
-		return poll.Continue("Status %s != %s (expected) for container %s", containerInspect.Status, status, containerID)
+		return poll.Continue("Status %s != %s (expected) for container %s", containerInspect.Status, statuses, containerID)
 	}
 
 	poll.WaitOn(t, checkStopped, poll.WithDelay(5*time.Second), poll.WithTimeout(90*time.Second))