Browse Source

Merge pull request #482 from docker/region_aci_tests

Change ACI test region to eastus2. Improve error output when waiting for container status
Guillaume Tardif 5 years ago
parent
commit
3859312c17
1 changed files with 6 additions and 4 deletions
  1. 6 4
      tests/aci-e2e/e2e-aci_test.go

+ 6 - 4
tests/aci-e2e/e2e-aci_test.go

@@ -52,7 +52,7 @@ import (
 
 const (
 	contextName = "aci-test"
-	location    = "westeurope"
+	location    = "eastus2"
 )
 
 var binDir string
@@ -665,12 +665,14 @@ func getContainerName(stdout string) string {
 }
 
 func waitForStatus(t *testing.T, c *E2eCLI, containerID string, status string) {
-	checkStopped := func(t poll.LogT) poll.Result {
+	checkStopped := func(logt poll.LogT) poll.Result {
 		res := c.RunDockerCmd("inspect", containerID)
-		if strings.Contains(res.Stdout(), status) {
+		containerInspect, err := ParseContainerInspect(res.Stdout())
+		assert.NilError(t, err)
+		if containerInspect.Status == status {
 			return poll.Success()
 		}
-		return poll.Continue("waiting for container to stop")
+		return poll.Continue("Status %s != %s (expected) for container %s", containerInspect.Status, status, containerID)
 	}
 
 	poll.WaitOn(t, checkStopped, poll.WithDelay(5*time.Second), poll.WithTimeout(60*time.Second))