File tree Expand file tree Collapse file tree 1 file changed +5
-4
lines changed
Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Original file line number Diff line number Diff line change @@ -1494,13 +1494,14 @@ var _ = Describe("controller", func() {
14941494 defer cancel ()
14951495
14961496 ctrl .CacheSyncTimeout = time .Second
1497+ numWatches := 10
14971498
14981499 var watchStartedCount atomic.Int32
1499- ctrl . startWatches = []source. TypedSource [reconcile. Request ] {
1500- source .Func (func (ctx context.Context , _ workqueue.TypedRateLimitingInterface [reconcile.Request ]) error {
1500+ for range numWatches {
1501+ ctrl . startWatches = append ( ctrl . startWatches , source .Func (func (ctx context.Context , _ workqueue.TypedRateLimitingInterface [reconcile.Request ]) error {
15011502 watchStartedCount .Add (1 )
15021503 return nil
1503- }),
1504+ }))
15041505 }
15051506
15061507 By ("calling Warmup and Start concurrently" )
@@ -1518,7 +1519,7 @@ var _ = Describe("controller", func() {
15181519
15191520 <- blockOnWarmupChan
15201521
1521- Expect (watchStartedCount .Load ()).To (Equal (int32 (1 )), "source should only be started once" )
1522+ Expect (watchStartedCount .Load ()).To (Equal (int32 (numWatches )), "source should only be started once" )
15221523 Expect (ctrl .startWatches ).To (BeNil (), "startWatches should be reset to nil after they are started" )
15231524 })
15241525
You can’t perform that action at this time.
0 commit comments