chore(Job): use WaitForCacheSync method after sharedInformerFactory Start

This commit is contained in:
googs1025 2024-07-19 23:41:20 +08:00
parent 01eb9f4754
commit af5b8bed70

View File

@ -6449,6 +6449,7 @@ func TestWatchJobs(t *testing.T) {
stopCh := make(chan struct{})
defer close(stopCh)
sharedInformerFactory.Start(stopCh)
sharedInformerFactory.WaitForCacheSync(stopCh)
go manager.Run(ctx, 1)
// We're sending new job to see if it reaches syncHandler.