integration: start informer and scheduler outside of InitTestScheduler
In case two or more controllers share the informers created through InitTestScheduler, it's not safe to start the informers until all controllers set their informer indexers. Otherwise, some controller might fail to register their indexers in time. Thus, it's responsibility of each consumer to make sure all informers are started after all controllers had time to get initiliazed.
This commit is contained in:
@@ -161,13 +161,14 @@ func TestTaintBasedEvictions(t *testing.T) {
|
||||
return
|
||||
}
|
||||
|
||||
go nc.Run(testCtx.Ctx.Done())
|
||||
|
||||
// Waiting for all controller sync.
|
||||
// Waiting for all controllers to sync
|
||||
externalInformers.Start(testCtx.Ctx.Done())
|
||||
externalInformers.WaitForCacheSync(testCtx.Ctx.Done())
|
||||
testCtx.InformerFactory.Start(testCtx.Ctx.Done())
|
||||
testCtx.InformerFactory.WaitForCacheSync(testCtx.Ctx.Done())
|
||||
testutils.SyncInformerFactory(testCtx)
|
||||
|
||||
// Run all controllers
|
||||
go nc.Run(testCtx.Ctx.Done())
|
||||
go testCtx.Scheduler.Run(testCtx.Ctx)
|
||||
|
||||
nodeRes := v1.ResourceList{
|
||||
v1.ResourceCPU: resource.MustParse("4000m"),
|
||||
|
Reference in New Issue
Block a user