diff --git a/pkg/controller/openapi/controller_test.go b/pkg/controller/openapi/controller_test.go index 468d4cfb8..e3204c766 100644 --- a/pkg/controller/openapi/controller_test.go +++ b/pkg/controller/openapi/controller_test.go @@ -332,6 +332,7 @@ func setup(t *testing.T) (*testEnv, context.Context) { ctx, cancel := context.WithCancel(context.Background()) factory.Start(ctx.Done()) + factory.WaitForCacheSync(ctx.Done()) env.mux = http.NewServeMux() h := handler.NewOpenAPIService(&spec.Swagger{})