Skip to content

Commit 18c0d6a

Browse files
committed
chore(validatingadmissionpolicystatus): use WaitForCacheSync after sharedInformerFactory Start in unit test
Signed-off-by: Omer Aplatony <[email protected]>
1 parent 60c4c2b commit 18c0d6a

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

pkg/controller/validatingadmissionpolicystatus/controller_test.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,7 @@ func TestTypeChecking(t *testing.T) {
114114
t.Fatalf("cannot create controller: %v", err)
115115
}
116116
informerFactory.Start(ctx.Done())
117+
informerFactory.WaitForCacheSync(ctx.Done())
117118
go controller.Run(ctx, 1)
118119
err = wait.PollUntilContextCancel(ctx, time.Second, false, func(ctx context.Context) (done bool, err error) {
119120
name := policy.Name

0 commit comments

Comments
 (0)