Merge pull request #110138 from wojtek-t/fix_leaking_goroutines_in_kubelet_test

Fix leaking goroutines in kubelet integration test
This commit is contained in:
Kubernetes Prow Robot
2022-05-23 04:06:01 -07:00
committed by GitHub
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")