Call non-blocking informerFactory.Start synchronously to avoid races

Signed-off-by: Dr. Stefan Schimanski <stefan.schimanski@gmail.com>
This commit is contained in:
Dr. Stefan Schimanski
2024-07-27 16:13:16 +02:00
parent 250f7b5d15
commit c7a1fa432a
9 changed files with 20 additions and 19 deletions

View File

@@ -152,7 +152,7 @@ func TestSyncHandler(t *testing.T) {
ec, _ := c.(*ephemeralController)
// Ensure informers are up-to-date.
go informerFactory.Start(ctx.Done())
informerFactory.Start(ctx.Done())
informerFactory.WaitForCacheSync(ctx.Done())
cache.WaitForCacheSync(ctx.Done(), podInformer.Informer().HasSynced, pvcInformer.Informer().HasSynced)