Skip to content

Commit

Permalink
Merge pull request #510 from lonegunmanb/retry-ingress
Browse files Browse the repository at this point in the history
Add retry when the ingress is not ready
  • Loading branch information
jiaweitao001 authored Feb 19, 2024
2 parents 632deec + 0bc00b5 commit 0e718ec
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
6 changes: 6 additions & 0 deletions test/e2e/terraform_aks_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import (
"regexp"
"strings"
"testing"
"time"

"github.com/hashicorp/go-retryablehttp"

Expand Down Expand Up @@ -157,6 +158,11 @@ func TestExamples_applicationGatewayIngress(t *testing.T) {
"use_brown_field_application_gateway": u.useBrownFieldAppGw,
"create_role_assignments_for_application_gateway": u.createRoleBindingForAppGw,
},
MaxRetries: 20,
TimeBetweenRetries: time.Minute,
RetryableTerraformErrors: map[string]string{
".*is empty list of object.*": "the ingress hasn't been created, need more time",
},
}, func(t *testing.T, output test_helper.TerraformOutput) {
url, ok := output["ingress_endpoint"].(string)
require.True(t, ok)
Expand Down
6 changes: 6 additions & 0 deletions test/upgrade/upgrade_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import (
"fmt"
"os"
"testing"
"time"

test_helper "github.com/Azure/terraform-module-test-helper"
"github.com/gruntwork-io/terratest/modules/terraform"
Expand Down Expand Up @@ -138,6 +139,11 @@ func TestExampleUpgrade_applicationGw(t *testing.T) {
"use_brown_field_application_gateway": u.useBrownFieldAppGw,
"create_role_assignments_for_application_gateway": u.createRoleBindingForAppGw,
},
MaxRetries: 20,
TimeBetweenRetries: time.Minute,
RetryableTerraformErrors: map[string]string{
".*is empty list of object.*": "the ingress hasn't been created, need more time",
},
}, currentMajorVersion)
})
}
Expand Down

0 comments on commit 0e718ec

Please sign in to comment.