From 10c2760fabc35baf48f3b64234b9d3955be6bda7 Mon Sep 17 00:00:00 2001 From: Dan Millwood Date: Wed, 12 Feb 2025 16:22:47 +0000 Subject: [PATCH] Fix intermittent test failure Start the informerFactory before WaitForCacheSync Kubernetes-commit: b9cd017a2146996677aa28ec992f7ed796f88c9b --- pkg/admission/plugin/policy/mutating/dispatcher_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/admission/plugin/policy/mutating/dispatcher_test.go b/pkg/admission/plugin/policy/mutating/dispatcher_test.go index 1cfb84152..8526e8b72 100644 --- a/pkg/admission/plugin/policy/mutating/dispatcher_test.go +++ b/pkg/admission/plugin/policy/mutating/dispatcher_test.go @@ -656,8 +656,8 @@ func TestDispatcher(t *testing.T) { if err != nil { t.Fatal(err) } - informerFactory.WaitForCacheSync(ctx.Done()) informerFactory.Start(ctx.Done()) + informerFactory.WaitForCacheSync(ctx.Done()) for i, h := range tc.policyHooks { tc.policyHooks[i].ParamInformer = paramInformer tc.policyHooks[i].ParamScope = testParamScope{}