Skip to content

Commit 2c6310b

Browse files
authored
Fix last flaky terratest (k8gb-io#1374)
* Fix last flaky terratest * Do not fail immediately on 503 * Fixes k8gb-io#1345 Signed-off-by: Yury Tsarev <[email protected]> * Remove concurrency limits from the jobs * Remove part of the config introduced by k8gb-io#1123 as the terratest suite is stable now Signed-off-by: Yury Tsarev <[email protected]> * Change way to check for 503 and also sleep for 1 second in case of detection Signed-off-by: Yury Tsarev <[email protected]> * Add more verbose logging to 503 edge case Signed-off-by: Yury Tsarev <[email protected]> --------- Signed-off-by: Yury Tsarev <[email protected]>
1 parent 572a192 commit 2c6310b

File tree

4 files changed

+8
-8
lines changed

4 files changed

+8
-8
lines changed

.github/workflows/terratest-more-clusters.yaml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,6 @@ on:
88
permissions:
99
contents: read
1010

11-
concurrency: terratest-${{ github.head_ref || github.run_id }}
12-
1311
jobs:
1412
terratest-n-clusters:
1513
runs-on: ubuntu-22.04

.github/workflows/terratest.yaml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,6 @@ on:
2121
permissions:
2222
contents: read
2323

24-
concurrency: terratest-${{ github.head_ref || github.run_id }}
25-
2624
jobs:
2725
skip-check:
2826
runs-on: ubuntu-latest

.github/workflows/upgrade-testing.yaml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,6 @@ on:
2121
permissions:
2222
contents: read
2323

24-
concurrency: terratest-${{ github.head_ref || github.run_id }}
25-
2624
jobs:
2725
skip-check:
2826
runs-on: ubuntu-latest

terratest/utils/extensions.go

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,14 +21,15 @@ Generated by GoLic, for more details see: https://github.com/AbsaOSS/golic
2121
import (
2222
"encoding/json"
2323
"fmt"
24-
"github.com/gruntwork-io/terratest/modules/retry"
2524
"os"
2625
"path/filepath"
2726
"strconv"
2827
"strings"
2928
"testing"
3029
"time"
3130

31+
"github.com/gruntwork-io/terratest/modules/retry"
32+
3233
"github.com/AbsaOSS/gopkg/dns"
3334
gopkgstr "github.com/AbsaOSS/gopkg/string"
3435
"github.com/gruntwork-io/terratest/modules/helm"
@@ -432,8 +433,13 @@ func (i *Instance) HitTestApp() (result *TestAppResult) {
432433
result = new(TestAppResult)
433434
coreDNSIP := i.GetCoreDNSIP()
434435
command := []string{"sh", "-c", fmt.Sprintf("wget -qO - %s", i.w.state.gslb.host)}
435-
for t := 0; t < 3; t++ {
436+
for t := 0; t < 60; t++ {
436437
result.Body, err = RunBusyBoxCommand(i.w.t, i.w.k8sOptions, coreDNSIP, command)
438+
if strings.Contains(result.Body, "503") {
439+
i.w.t.Log("podinfo returns 503, trying again....")
440+
time.Sleep(time.Second * 1)
441+
continue
442+
}
437443
require.NoError(i.w.t, err, "busybox", command, result.Body)
438444
if strings.HasPrefix(result.Body, "{") {
439445
break

0 commit comments

Comments
 (0)