diff --git a/terratest/test/k8gb_failover_playground_test.go b/terratest/test/k8gb_failover_playground_test.go index e5e3d19817..1f7d33c08c 100644 --- a/terratest/test/k8gb_failover_playground_test.go +++ b/terratest/test/k8gb_failover_playground_test.go @@ -81,7 +81,8 @@ func TestFailoverPlayground(t *testing.T) { t.Run("start podinfo again on eu cluster", func(t *testing.T) { instanceEU.StartTestApp() - require.NoError(t, instanceEU.WaitForAppIsRunning()) + err = instanceEU.WaitForAppIsRunning() + require.NoError(t, err) actAndAssert(t.Name(), euGeoTag, euLocalTargets) }) } diff --git a/terratest/utils/extensions.go b/terratest/utils/extensions.go index c0901fa693..ec982d5115 100644 --- a/terratest/utils/extensions.go +++ b/terratest/utils/extensions.go @@ -21,7 +21,6 @@ Generated by GoLic, for more details see: https://github.com/AbsaOSS/golic import ( "encoding/json" "fmt" - "github.com/gruntwork-io/terratest/modules/retry" "os" "path/filepath" "strconv" @@ -29,6 +28,8 @@ import ( "testing" "time" + "github.com/gruntwork-io/terratest/modules/retry" + "github.com/AbsaOSS/gopkg/dns" gopkgstr "github.com/AbsaOSS/gopkg/string" "github.com/gruntwork-io/terratest/modules/helm" @@ -432,8 +433,11 @@ func (i *Instance) HitTestApp() (result *TestAppResult) { result = new(TestAppResult) coreDNSIP := i.GetCoreDNSIP() command := []string{"sh", "-c", fmt.Sprintf("wget -qO - %s", i.w.state.gslb.host)} - for t := 0; t < 3; t++ { + for t := 0; t < 60; t++ { result.Body, err = RunBusyBoxCommand(i.w.t, i.w.k8sOptions, coreDNSIP, command) + if err != nil && strings.Contains(err.Error(), "503") { + continue + } require.NoError(i.w.t, err, "busybox", command, result.Body) if strings.HasPrefix(result.Body, "{") { break