Skip to content
This repository was archived by the owner on Jul 18, 2025. It is now read-only.

Commit 352ba59

Browse files
author
Ulysses Souza
authored
Merge pull request #2078 from docker/fix-aci-ecs-unsupported
Fix default values on ACI flags
2 parents 54c2853 + 86470ba commit 352ba59

File tree

4 files changed

+29
-21
lines changed

4 files changed

+29
-21
lines changed

Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,10 +54,10 @@ e2e-kube: ## Run End to end Kube tests. Set E2E_TEST=TestName to run a single te
5454
go test -timeout 10m -count=1 -v $(TEST_FLAGS) ./kube/e2e
5555

5656
e2e-aci: ## Run End to end ACI tests. Set E2E_TEST=TestName to run a single test
57-
go test -timeout 15m -count=1 -v $(TEST_FLAGS) ./aci/e2e
57+
go test -timeout 20m -count=1 -v $(TEST_FLAGS) ./aci/e2e
5858

5959
e2e-ecs: ## Run End to end ECS tests. Set E2E_TEST=TestName to run a single test
60-
go test -timeout 20m -count=1 -v $(TEST_FLAGS) ./ecs/e2e/ecs ./ecs/e2e/ecs-local
60+
go test -timeout 30m -count=1 -v $(TEST_FLAGS) ./ecs/e2e/ecs ./ecs/e2e/ecs-local
6161

6262
cross: ## Compile the CLI for linux, darwin and windows
6363
@docker build . --target cross \

aci/compose.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -101,10 +101,10 @@ func checkUnsupportedUpOptions(ctx context.Context, o api.UpOptions) error {
101101
option string
102102
}{
103103
{o.Start.CascadeStop, false, "abort-on-container-exit"},
104-
{o.Create.RecreateDependencies, "", "always-recreate-deps"},
104+
{o.Create.RecreateDependencies, api.RecreateDiverged, "always-recreate-deps"},
105105
{len(o.Start.AttachTo), 0, "attach-dependencies"},
106106
{len(o.Start.ExitCodeFrom), 0, "exit-code-from"},
107-
{o.Create.Recreate, "", "force-recreate"},
107+
{o.Create.Recreate, api.RecreateDiverged, "force-recreate"},
108108
{o.Create.QuietPull, false, "quiet-pull"},
109109
{o.Create.RemoveOrphans, false, "remove-orphans"},
110110
{o.Create.Inherit, true, "renew-anon-volumes"},

aci/e2e/e2e-aci_test.go

Lines changed: 18 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -295,7 +295,7 @@ func TestRunVolume(t *testing.T) {
295295
})
296296

297297
t.Run("http get", func(t *testing.T) {
298-
output := HTTPGetWithRetry(t, endpoint, http.StatusOK, 2*time.Second, 20*time.Second)
298+
output := HTTPGetWithRetry(t, endpoint, http.StatusOK, 2*time.Second, time.Minute)
299299
assert.Assert(t, strings.Contains(output, testFileContent), "Actual content: "+output)
300300
})
301301

@@ -584,12 +584,12 @@ func TestUpSecretsResources(t *testing.T) {
584584
assert.Assert(t, is.Len(web1Inspect.Ports, 1))
585585
endpoint := fmt.Sprintf("http://%s:%d", web1Inspect.Ports[0].HostIP, web1Inspect.Ports[0].HostPort)
586586

587-
output := HTTPGetWithRetry(t, endpoint+"/"+secret1Name, http.StatusOK, 2*time.Second, 20*time.Second)
587+
output := HTTPGetWithRetry(t, endpoint+"/"+secret1Name, http.StatusOK, 2*time.Second, time.Minute)
588588
// replace windows carriage return
589589
output = strings.ReplaceAll(output, "\r", "")
590590
assert.Equal(t, output, secret1Value)
591591

592-
output = HTTPGetWithRetry(t, endpoint+"/"+secret2Name, http.StatusOK, 2*time.Second, 20*time.Second)
592+
output = HTTPGetWithRetry(t, endpoint+"/"+secret2Name, http.StatusOK, 2*time.Second, time.Minute)
593593
output = strings.ReplaceAll(output, "\r", "")
594594
assert.Equal(t, output, secret2Value)
595595
})
@@ -598,11 +598,11 @@ func TestUpSecretsResources(t *testing.T) {
598598
assert.Assert(t, is.Len(web2Inspect.Ports, 1))
599599
endpoint := fmt.Sprintf("http://%s:%d", web2Inspect.Ports[0].HostIP, web2Inspect.Ports[0].HostPort)
600600

601-
output := HTTPGetWithRetry(t, endpoint+"/"+secret2Name, http.StatusOK, 2*time.Second, 20*time.Second)
601+
output := HTTPGetWithRetry(t, endpoint+"/"+secret2Name, http.StatusOK, 2*time.Second, time.Minute)
602602
output = strings.ReplaceAll(output, "\r", "")
603603
assert.Equal(t, output, secret2Value)
604604

605-
HTTPGetWithRetry(t, endpoint+"/"+secret1Name, http.StatusNotFound, 2*time.Second, 20*time.Second)
605+
HTTPGetWithRetry(t, endpoint+"/"+secret1Name, http.StatusNotFound, 2*time.Second, time.Minute)
606606
})
607607

608608
t.Run("check resource limits", func(t *testing.T) {
@@ -627,7 +627,7 @@ func TestUpSecretsResources(t *testing.T) {
627627

628628
t.Run("healthcheck restart failed app", func(t *testing.T) {
629629
endpoint := fmt.Sprintf("http://%s:%d", web1Inspect.Ports[0].HostIP, web1Inspect.Ports[0].HostPort)
630-
HTTPGetWithRetry(t, endpoint+"/failtestserver", http.StatusOK, 3*time.Second, 3*time.Second)
630+
HTTPGetWithRetry(t, endpoint+"/failtestserver", http.StatusOK, 3*time.Second, time.Minute)
631631

632632
logs := c.RunDockerCmd("logs", web1).Combined()
633633
assert.Assert(t, strings.Contains(logs, "GET /healthz"))
@@ -729,14 +729,14 @@ func TestUpUpdate(t *testing.T) {
729729
assert.Assert(t, is.Len(containerInspect.Ports, 1))
730730
endpoint := fmt.Sprintf("http://%s:%d", containerInspect.Ports[0].HostIP, containerInspect.Ports[0].HostPort)
731731

732-
output := HTTPGetWithRetry(t, endpoint+"/words/noun", http.StatusOK, 2*time.Second, 20*time.Second)
732+
output := HTTPGetWithRetry(t, endpoint+"/words/noun", http.StatusOK, 2*time.Second, time.Minute)
733733

734734
assert.Assert(t, strings.Contains(output, `"word":`))
735735

736736
endpoint = fmt.Sprintf("http://%s:%d", fqdn, containerInspect.Ports[0].HostPort)
737-
HTTPGetWithRetry(t, endpoint+"/words/noun", http.StatusOK, 2*time.Second, 20*time.Second)
737+
HTTPGetWithRetry(t, endpoint+"/words/noun", http.StatusOK, 2*time.Second, time.Minute)
738738

739-
body := HTTPGetWithRetry(t, endpoint+"/volume_test/"+testFileName, http.StatusOK, 2*time.Second, 20*time.Second)
739+
body := HTTPGetWithRetry(t, endpoint+"/volume_test/"+testFileName, http.StatusOK, 2*time.Second, time.Minute)
740740
assert.Assert(t, strings.Contains(body, testFileContent))
741741

742742
// Try to remove the volume while it's still in use
@@ -760,17 +760,22 @@ func TestUpUpdate(t *testing.T) {
760760
for _, line := range l {
761761
fields := strings.Fields(line)
762762
name := fields[0]
763+
763764
switch name {
764765
case wordsContainer:
765766
wordsDisplayed = true
766-
assert.Equal(t, fields[2], "Running")
767+
assert.Check(t, len(fields) >= 4)
768+
assert.Equal(t, fields[3], "Running", "Got -> %q. All fields -> %#v", fields[3], fields)
767769
case dbContainer:
768770
dbDisplayed = true
769-
assert.Equal(t, fields[2], "Running")
771+
assert.Check(t, len(fields) >= 4)
772+
assert.Equal(t, fields[3], "Running", "Got -> %q. All fields -> %#v", fields[3], fields)
770773
case serverContainer:
771774
webDisplayed = true
772-
assert.Equal(t, fields[2], "Running")
773-
assert.Check(t, strings.Contains(fields[3], ":80->80/tcp"))
775+
assert.Check(t, len(fields) >= 4)
776+
assert.Equal(t, fields[3], "Running", "Got -> %q. All fields -> %#v", fields[3], fields)
777+
assert.Check(t, len(fields) >= 5)
778+
assert.Check(t, strings.Contains(fields[4], ":80->80/tcp"), "Got -> %q. All fields -> %#v", fields[4], fields)
774779
}
775780
}
776781
assert.Check(t, webDisplayed, "webDisplayed"+res.Stdout())

ecs/e2e/ecs/e2e-ecs_test.go

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -102,15 +102,18 @@ func TestCompose(t *testing.T) {
102102
assert.DeepEqual(t, fields, []string{containerID, serviceName, "Running"})
103103
case "words":
104104
wordsDisplayed = true
105-
assert.Check(t, strings.Contains(fields[3], ":8080->8080/tcp"))
105+
assert.Check(t, strings.Contains(fields[3], ":8080->8080/tcp"),
106+
"Got -> %q. All fields -> %#v", fields[3], fields)
106107
wordsURL = "http://" + strings.Replace(fields[3], "->8080/tcp", "", 1) + "/noun"
107108
case "web":
108109
webDisplayed = true
109-
assert.Check(t, strings.Contains(fields[3], ":80->80/tcp"))
110+
assert.Check(t, strings.Contains(fields[3], ":80->80/tcp"),
111+
"Got -> %q. All fields -> %#v", fields[3], fields)
110112
webURL = "http://" + strings.Replace(fields[3], "->80/tcp", "", 1)
111113
case "websecrets":
112114
secretsDisplayed = true
113-
assert.Check(t, strings.Contains(fields[3], ":90->90/tcp"))
115+
assert.Check(t, strings.Contains(fields[3], ":90->90/tcp"),
116+
"Got -> %q. All fields -> %#v", fields[3], fields)
114117
secretsURL = "http://" + strings.Replace(fields[3], "->90/tcp", "", 1)
115118
}
116119
}
@@ -169,7 +172,7 @@ func TestCompose(t *testing.T) {
169172
func setupTest(t *testing.T) (*E2eCLI, string) {
170173
startTime := strconv.Itoa(int(time.Now().UnixNano()))
171174
c := NewParallelE2eCLI(t, binDir)
172-
contextName := "e2e" + t.Name() + startTime
175+
contextName := "e2e" + strings.ToLower(t.Name()) + startTime
173176
stack := contextName
174177
t.Run("create context", func(t *testing.T) {
175178
localTestProfile := os.Getenv("TEST_AWS_PROFILE")

0 commit comments

Comments
 (0)