From 459a4d81b88898ca49a3fb60be4021332c3432ba Mon Sep 17 00:00:00 2001 From: Tianchu Zhao Date: Wed, 22 Sep 2021 09:36:26 +1000 Subject: [PATCH] fix(controller): TestPodExists unit test, add delay to wait for informer getting pod info Signed-off-by: Tianchu Zhao --- workflow/controller/workflowpod_test.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/workflow/controller/workflowpod_test.go b/workflow/controller/workflowpod_test.go index 4cdcbc75bb4e..73a3bbea9932 100644 --- a/workflow/controller/workflowpod_test.go +++ b/workflow/controller/workflowpod_test.go @@ -1637,6 +1637,8 @@ func TestPodExists(t *testing.T) { assert.NoError(t, err) assert.Len(t, pods.Items, 1) + // Sleep 1 second to wait for informer getting pod info + time.Sleep(time.Second) existingPod, doesExist, err := woc.podExists(pod.ObjectMeta.Name) assert.NoError(t, err) assert.NotNil(t, existingPod)