Skip to content

Commit 6b4eab6

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

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
@@ -493,7 +493,8 @@ func NonBlockingGetTest(createCacheFunc func(config *rest.Config, opts cache.Opt
493493
},
494494
}
495495

496-
ctx, _ := context.WithTimeout(context.Background(), 5*time.Second)
496+
ctx, cancel := context.WithTimeout(context.Background(), 5*time.Second)
497+
defer cancel()
497498
sii, err := informerCache.GetInformer(ctx, pod, cache.BlockUntilSynced(false))
498499
Expect(err).NotTo(HaveOccurred())
499500
Expect(sii).NotTo(BeNil())

0 commit comments

Comments
 (0)