From 387a10b764418fd3a19259715eac8b192464293c Mon Sep 17 00:00:00 2001 From: Traian Schiau Date: Tue, 30 Jan 2024 14:43:14 +0200 Subject: [PATCH] [util/e2e] Rework KueueReadyForTesting. --- test/util/e2e.go | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/test/util/e2e.go b/test/util/e2e.go index 4539b02342..9ebaf95092 100644 --- a/test/util/e2e.go +++ b/test/util/e2e.go @@ -65,11 +65,19 @@ func CreateVisibilityClient(user string) visibilityv1alpha1.VisibilityV1alpha1In return visibilityClient } -func KueueReadyForTesting(ctx context.Context, client client.Client) { +func KueueReadyForTesting(ctx context.Context, c client.Client) { // To verify that webhooks are ready, let's create a simple resourceflavor resourceKueue := utiltesting.MakeResourceFlavor("default").Obj() - gomega.Eventually(func() error { - return client.Create(context.Background(), resourceKueue) + gomega.EventuallyWithOffset(1, func() error { + return c.Create(ctx, resourceKueue) }, StartUpTimeout, Interval).Should(gomega.Succeed()) - ExpectResourceFlavorToBeDeleted(ctx, client, resourceKueue, true) + + gomega.EventuallyWithOffset(1, func() error { + return c.Delete(ctx, resourceKueue) + }, StartUpTimeout, Interval).Should(gomega.Succeed()) + + gomega.EventuallyWithOffset(1, func() error { + oldRf := &kueue.ResourceFlavor{} + return c.Get(ctx, client.ObjectKeyFromObject(resourceKueue), oldRf) + }, StartUpTimeout, Interval).Should(utiltesting.BeNotFoundError()) }