From 5697b6a6693d6529150dcedcbcb08be8ab33411f Mon Sep 17 00:00:00 2001 From: Lubron Zhan Date: Tue, 12 Mar 2024 18:00:43 -0700 Subject: [PATCH] Fix unit test Signed-off-by: Lubron Zhan --- controllers/machine/machine_controller_intg_test.go | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/controllers/machine/machine_controller_intg_test.go b/controllers/machine/machine_controller_intg_test.go index eb70a0e4..9e0e8b8e 100644 --- a/controllers/machine/machine_controller_intg_test.go +++ b/controllers/machine/machine_controller_intg_test.go @@ -93,10 +93,11 @@ func intgTestMachineController() { }) It("Corresponding Endpoints should be created", func() { ep := &corev1.Endpoints{} - Eventually(func() error { - return ctx.Client.Get(ctx.Context, client.ObjectKey{Name: cluster.Namespace + "-" + cluster.Name + "-control-plane", Namespace: cluster.Namespace}, ep) - }).Should(Succeed()) Eventually(func() int { + err := ctx.Client.Get(ctx.Context, client.ObjectKey{Name: cluster.Namespace + "-" + cluster.Name + "-control-plane", Namespace: cluster.Namespace}, ep) + if err != nil { + return 0 + } if len(ep.Subsets) == 0 { return 0 }