Skip to content

Commit 812a6a7

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

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
@@ -490,7 +490,8 @@ func NonBlockingGetTest(createCacheFunc func(config *rest.Config, opts cache.Opt
490490
},
491491
}
492492

493-
ctx, _ := context.WithTimeout(context.Background(), 5*time.Second)
493+
ctx, cancel := context.WithTimeout(context.Background(), 5*time.Second)
494+
defer cancel()
494495
sii, err := informerCache.GetInformer(ctx, pod, cache.BlockUntilSynced(false))
495496
Expect(err).NotTo(HaveOccurred())
496497
Expect(sii).NotTo(BeNil())

0 commit comments

Comments
 (0)