From cc58fdd55bd46c6c84258702db5368620b95fe68 Mon Sep 17 00:00:00 2001 From: Michael Henriksen Date: Mon, 15 Jul 2019 10:14:25 -0400 Subject: [PATCH] aparently, there may be a delay between the time permissions are applied and enforced so let's retry --- tests/webhook_test.go | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/tests/webhook_test.go b/tests/webhook_test.go index a60c37b068..6ea5cb1c8f 100644 --- a/tests/webhook_test.go +++ b/tests/webhook_test.go @@ -2,6 +2,7 @@ package tests import ( "fmt" + "time" . "github.com/onsi/ginkgo" . "github.com/onsi/gomega" @@ -66,8 +67,10 @@ var _ = Describe("Clone Auth Webhook tests", func() { addPermissionToNamespace(f.K8sClient, serviceAccountName, targetNamespace.Name, f.Namespace.Name) // now can list dvs in source - _, err = client.CdiV1alpha1().DataVolumes(f.Namespace.Name).List(metav1.ListOptions{}) - Expect(err).ToNot(HaveOccurred()) + Eventually(func() error { + _, err = client.CdiV1alpha1().DataVolumes(f.Namespace.Name).List(metav1.ListOptions{}) + return err + }, 60*time.Second, 2*time.Second).ShouldNot(HaveOccurred()) // now can create clone of dv in source _, err = client.CdiV1alpha1().DataVolumes(targetNamespace.Name).Create(targetDV)