Skip to content

Commit c1a5142

Browse files
committed
Add deferred cancel call to test
Signed-off-by: Max Smythe <[email protected]>
1 parent a75ba20 commit c1a5142

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

pkg/cache/cache_test.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -587,7 +587,8 @@ func NonBlockingGetTest(createCacheFunc func(config *rest.Config, opts cache.Opt
587587
},
588588
}
589589

590-
ctx, _ := context.WithTimeout(context.Background(), 5*time.Second)
590+
ctx, cancel := context.WithTimeout(context.Background(), 5*time.Second)
591+
defer cancel()
591592
sii, err := informerCache.GetInformer(ctx, pod, cache.BlockUntilSynced(false))
592593
Expect(err).NotTo(HaveOccurred())
593594
Expect(sii).NotTo(BeNil())

0 commit comments

Comments
 (0)