Fix intermittent test failure

Start the informerFactory before WaitForCacheSync
This commit is contained in:
Dan Millwood 2025-02-12 16:22:47 +00:00 committed by GitHub
parent 75909b8920
commit b9cd017a21
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -656,8 +656,8 @@ func TestDispatcher(t *testing.T) {
if err != nil { if err != nil {
t.Fatal(err) t.Fatal(err)
} }
informerFactory.WaitForCacheSync(ctx.Done())
informerFactory.Start(ctx.Done()) informerFactory.Start(ctx.Done())
informerFactory.WaitForCacheSync(ctx.Done())
for i, h := range tc.policyHooks { for i, h := range tc.policyHooks {
tc.policyHooks[i].ParamInformer = paramInformer tc.policyHooks[i].ParamInformer = paramInformer
tc.policyHooks[i].ParamScope = testParamScope{} tc.policyHooks[i].ParamScope = testParamScope{}