Skip to content

Commit

Permalink
add retry when the ingress is not ready
Browse files Browse the repository at this point in the history
  • Loading branch information
lonegunmanb committed Feb 18, 2024
1 parent 632deec commit 0bc00b5
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 0bc00b5

Please sign in to comment.