From ca94a3c44cf582f550ae330b6dabf36ebddc99ad Mon Sep 17 00:00:00 2001 From: Fabian Kammel Date: Tue, 3 Jan 2023 12:41:46 +0100 Subject: [PATCH] Fix failing e2e test for lb (#850) Signed-off-by: Fabian Kammel --- .github/actions/e2e_lb/action.yml | 2 +- e2e/internal/lb/lb_test.go | 16 +++++++++------- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/.github/actions/e2e_lb/action.yml b/.github/actions/e2e_lb/action.yml index 1eb7dce5f..ca9474f4c 100644 --- a/.github/actions/e2e_lb/action.yml +++ b/.github/actions/e2e_lb/action.yml @@ -28,4 +28,4 @@ runs: working-directory: ./.github/actions/e2e_lb run: | kubectl delete -f lb.yml - kubectl delete -f ns.yml + kubectl delete -f ns.yml --timeout=5m diff --git a/e2e/internal/lb/lb_test.go b/e2e/internal/lb/lb_test.go index 2018af680..42dacc457 100644 --- a/e2e/internal/lb/lb_test.go +++ b/e2e/internal/lb/lb_test.go @@ -32,7 +32,7 @@ const ( newPort = int32(8044) numRequests = 256 numPods = 3 - timeout = time.Minute * 5 + timeout = time.Minute * 15 interval = time.Second * 5 ) @@ -120,17 +120,19 @@ func testEventuallyStatusOK(t *testing.T, url string) { }, timeout, interval) } -// testEventuallyExternalIPAvailable uses k to query if the whoami service is available -// within 5 minutes. Once the service is available the Service is returned. +// testEventuallyExternalIPAvailable uses k to query if the whoami service is eventually available. +// Once the service is available the Service is returned. func testEventuallyExternalIPAvailable(t *testing.T, k *kubernetes.Clientset) *coreV1.Service { - assert := assert.New(t) - require := require.New(t) var svc *coreV1.Service - assert.Eventually(func() bool { + require.Eventually(t, func() bool { var err error svc, err = k.CoreV1().Services(namespaceName).Get(context.Background(), serviceName, v1.GetOptions{}) - require.NoError(err) + if err != nil { + fmt.Println(err) + return false + } + fmt.Printf("Fetched service: %v\n", svc.String()) return len(svc.Status.LoadBalancer.Ingress) > 0 }, timeout, interval)