From c69f3e81ebf895454b81bbcde2d48cdd8a2e113c Mon Sep 17 00:00:00 2001 From: fabriziopandini Date: Mon, 18 Jan 2021 11:49:58 +0100 Subject: [PATCH] Wait for test config map to be created --- .../controllers/clusterresourceset_controller_test.go | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/exp/addons/controllers/clusterresourceset_controller_test.go b/exp/addons/controllers/clusterresourceset_controller_test.go index 6cad4b75bc53..d86ac91c8e84 100644 --- a/exp/addons/controllers/clusterresourceset_controller_test.go +++ b/exp/addons/controllers/clusterresourceset_controller_test.go @@ -297,6 +297,15 @@ metadata: Data: map[string]string{}, } Expect(testEnv.Create(ctx, testConfigmap)).To(Succeed()) + cmKey := client.ObjectKey{ + Namespace: defaultNamespaceName, + Name: newCMName, + } + Eventually(func() bool { + m := &corev1.ConfigMap{} + err := testEnv.Get(ctx, cmKey, m) + return err == nil + }, timeout).Should(BeTrue()) // When the ConfigMap resource is created, CRS should get reconciled immediately. Eventually(func() bool {