From 49ea2211c3bd4e6f342145b1e72d2f0ac2dc73ab Mon Sep 17 00:00:00 2001 From: Andrew Bays Date: Fri, 7 Jun 2024 20:22:38 +0000 Subject: [PATCH] Fix race condition in OpenStackVersion func test --- tests/functional/base_test.go | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/tests/functional/base_test.go b/tests/functional/base_test.go index 627126787..388f9df4e 100644 --- a/tests/functional/base_test.go +++ b/tests/functional/base_test.go @@ -254,10 +254,13 @@ func OpenStackVersionConditionGetter(name types.NamespacedName) condition.Condit return instance.Status.Conditions } -func OpenStackVersionRemoveFinalizer(ctx context.Context, name types.NamespacedName) error { - instance := GetOpenStackVersion(name) - instance.SetFinalizers([]string{}) - return th.K8sClient.Update(ctx, instance) +func OpenStackVersionRemoveFinalizer(ctx context.Context, name types.NamespacedName) { + Eventually(func(g Gomega) { + instance := GetOpenStackVersion(name) + instance.SetFinalizers([]string{}) + g.Expect(th.K8sClient.Update(ctx, instance)).Should(Succeed()) + + }, timeout, interval).Should(Succeed()) } func CreateOpenStackControlPlane(name types.NamespacedName, spec map[string]interface{}) client.Object {