From 7a055fcb9ffe43d085a1a0fb4e95708b79fc25f7 Mon Sep 17 00:00:00 2001 From: Dario Tranchitella Date: Sat, 24 Jul 2021 11:58:03 +0200 Subject: [PATCH] fix(test): matching upon reconciliation, not retrieval --- e2e/tenant_resources_test.go | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/e2e/tenant_resources_test.go b/e2e/tenant_resources_test.go index 6e1bf157..40fb5721 100644 --- a/e2e/tenant_resources_test.go +++ b/e2e/tenant_resources_test.go @@ -204,12 +204,14 @@ var _ = Describe("creating namespaces within a Tenant with resources", func() { }) By("checking the Resource Quota", func() { for i, s := range tnt.Spec.ResourceQuota.Items { - n := fmt.Sprintf("capsule-%s-%d", tnt.GetName(), i) - rq := &corev1.ResourceQuota{} - Eventually(func() error { - return k8sClient.Get(context.TODO(), types.NamespacedName{Name: n, Namespace: name}, rq) - }, defaultTimeoutInterval, defaultPollInterval).Should(Succeed()) - Expect(rq.Spec).Should(Equal(s)) + Eventually(func() corev1.ResourceQuotaSpec { + n := fmt.Sprintf("capsule-%s-%d", tnt.GetName(), i) + + rq := &corev1.ResourceQuota{} + Expect(k8sClient.Get(context.TODO(), types.NamespacedName{Name: n, Namespace: name}, rq)).Should(Succeed()) + + return rq.Spec + }, defaultTimeoutInterval, defaultPollInterval).Should(Equal(s)) } }) }