From a4ec5c8a880f28950b0faff940705f3209732f5b Mon Sep 17 00:00:00 2001 From: Manuel Alejandro de Brito Fontes Date: Tue, 21 Jul 2020 09:14:59 -0400 Subject: [PATCH] Validate endpoints are ready in e2e tests --- test/e2e/annotations/auth.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/test/e2e/annotations/auth.go b/test/e2e/annotations/auth.go index 2d2c2ea0f..b8fcc13ac 100644 --- a/test/e2e/annotations/auth.go +++ b/test/e2e/annotations/auth.go @@ -443,9 +443,14 @@ var _ = framework.DescribeAnnotation("auth-*", func() { err := framework.WaitForEndpoints(f.KubeClientSet, framework.DefaultTimeout, framework.HTTPBinService, f.Namespace, 1) assert.Nil(ginkgo.GinkgoT(), err) + framework.Sleep(1) + e, err := f.KubeClientSet.CoreV1().Endpoints(f.Namespace).Get(context.TODO(), framework.HTTPBinService, metav1.GetOptions{}) assert.Nil(ginkgo.GinkgoT(), err) + assert.GreaterOrEqual(ginkgo.GinkgoT(), len(e.Subsets), 1, "expected at least one endpoint") + assert.GreaterOrEqual(ginkgo.GinkgoT(), len(e.Subsets[0].Addresses), 1, "expected at least one address ready in the endpoint") + httpbinIP = e.Subsets[0].Addresses[0].IP annotations := map[string]string{