From 23dfc5549b87b3b91b598ce5a04e6d22cbdbbb62 Mon Sep 17 00:00:00 2001 From: Malte Poll Date: Mon, 15 Aug 2022 15:12:10 +0200 Subject: [PATCH] [node-operator] nodeimage-controller: improve test robustness Signed-off-by: Malte Poll --- .../controllers/nodeimage_controller_env_test.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/operators/constellation-node-operator/controllers/nodeimage_controller_env_test.go b/operators/constellation-node-operator/controllers/nodeimage_controller_env_test.go index f170a9077..52a740188 100644 --- a/operators/constellation-node-operator/controllers/nodeimage_controller_env_test.go +++ b/operators/constellation-node-operator/controllers/nodeimage_controller_env_test.go @@ -174,7 +174,10 @@ var _ = Describe("NodeImage controller", func() { Eventually(func() error { return k8sClient.Get(ctx, joiningPendingNodeLookupKey, pendingNode) }).Should(Succeed()) - Expect(pendingNode.Status.CSPNodeState).Should(Equal(updatev1alpha1.NodeStateReady)) + Eventually(func() updatev1alpha1.CSPNodeState { + k8sClient.Get(ctx, joiningPendingNodeLookupKey, pendingNode) + return pendingNode.Status.CSPNodeState + }).Should(Equal(updatev1alpha1.NodeStateReady)) Eventually(func() int { if err := k8sClient.Get(ctx, nodeImageLookupKey, nodeImage); err != nil { return 0