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() {
1494
1494
defer cancel ()
1495
1495
1496
1496
ctrl .CacheSyncTimeout = time .Second
1497
+ numWatches := 10
1497
1498
1498
1499
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 {
1501
1502
watchStartedCount .Add (1 )
1502
1503
return nil
1503
- }),
1504
+ }))
1504
1505
}
1505
1506
1506
1507
By ("calling Warmup and Start concurrently" )
@@ -1518,7 +1519,7 @@ var _ = Describe("controller", func() {
1518
1519
1519
1520
<- blockOnWarmupChan
1520
1521
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" )
1522
1523
Expect (ctrl .startWatches ).To (BeNil (), "startWatches should be reset to nil after they are started" )
1523
1524
})
1524
1525
You can’t perform that action at this time.
0 commit comments