mirror of
https://github.com/k3s-io/kubernetes.git
synced 2026-01-13 11:25:19 +00:00
test: ensure WaitForCacheSync is called after starting sharedInformerFacotry
Signed-off-by: knight42 <anonymousknight96@gmail.com>
This commit is contained in:
@@ -322,13 +322,12 @@ func TestControllerSync(t *testing.T) {
|
||||
// Start the controller
|
||||
stopCh := make(chan struct{})
|
||||
informers.Start(stopCh)
|
||||
informers.WaitForCacheSync(stopCh)
|
||||
go ctrl.Run(stopCh)
|
||||
|
||||
// Wait for the controller to pass initial sync and fill its caches.
|
||||
err = wait.Poll(10*time.Millisecond, wait.ForeverTestTimeout, func() (bool, error) {
|
||||
return ctrl.volumeListerSynced() &&
|
||||
ctrl.claimListerSynced() &&
|
||||
len(ctrl.claims.ListKeys()) >= len(test.initialClaims) &&
|
||||
return len(ctrl.claims.ListKeys()) >= len(test.initialClaims) &&
|
||||
len(ctrl.volumes.store.ListKeys()) >= len(test.initialVolumes), nil
|
||||
})
|
||||
if err != nil {
|
||||
|
||||
Reference in New Issue
Block a user