Fix failing e2e test for lb (#850)

Signed-off-by: Fabian Kammel <fk@edgeless.systems>
This commit is contained in:
Fabian Kammel 2023-01-03 12:41:46 +01:00 committed by GitHub
parent 324ef42c42
commit ca94a3c44c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 10 additions and 8 deletions

View File

@ -28,4 +28,4 @@ runs:
working-directory: ./.github/actions/e2e_lb working-directory: ./.github/actions/e2e_lb
run: | run: |
kubectl delete -f lb.yml kubectl delete -f lb.yml
kubectl delete -f ns.yml kubectl delete -f ns.yml --timeout=5m

View File

@ -32,7 +32,7 @@ const (
newPort = int32(8044) newPort = int32(8044)
numRequests = 256 numRequests = 256
numPods = 3 numPods = 3
timeout = time.Minute * 5 timeout = time.Minute * 15
interval = time.Second * 5 interval = time.Second * 5
) )
@ -120,17 +120,19 @@ func testEventuallyStatusOK(t *testing.T, url string) {
}, timeout, interval) }, timeout, interval)
} }
// testEventuallyExternalIPAvailable uses k to query if the whoami service is available // testEventuallyExternalIPAvailable uses k to query if the whoami service is eventually available.
// within 5 minutes. Once the service is available the Service is returned. // Once the service is available the Service is returned.
func testEventuallyExternalIPAvailable(t *testing.T, k *kubernetes.Clientset) *coreV1.Service { func testEventuallyExternalIPAvailable(t *testing.T, k *kubernetes.Clientset) *coreV1.Service {
assert := assert.New(t)
require := require.New(t)
var svc *coreV1.Service var svc *coreV1.Service
assert.Eventually(func() bool { require.Eventually(t, func() bool {
var err error var err error
svc, err = k.CoreV1().Services(namespaceName).Get(context.Background(), serviceName, v1.GetOptions{}) 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 return len(svc.Status.LoadBalancer.Ingress) > 0
}, timeout, interval) }, timeout, interval)