Fix leaking goroutines in kubelet integration test

This commit is contained in:
Wojciech Tyczyński
2022-05-19 22:09:04 +02:00
parent 32773d61c4
commit 0d41d2921e
2 changed files with 42 additions and 11 deletions

View File

@@ -63,7 +63,10 @@ func TestWatchBasedManager(t *testing.T) {
// So don't treat any secret as immutable here.
isImmutable := func(_ runtime.Object) bool { return false }
fakeClock := testingclock.NewFakeClock(time.Now())
store := manager.NewObjectCache(listObj, watchObj, newObj, isImmutable, schema.GroupResource{Group: "v1", Resource: "secrets"}, fakeClock, time.Minute)
stopCh := make(chan struct{})
defer close(stopCh)
store := manager.NewObjectCache(listObj, watchObj, newObj, isImmutable, schema.GroupResource{Group: "v1", Resource: "secrets"}, fakeClock, time.Minute, stopCh)
// create 1000 secrets in parallel
t.Log(time.Now(), "creating 1000 secrets")