From e2812ce31291cc1728686df5cd1ce20e688aa9b2 Mon Sep 17 00:00:00 2001 From: Chao Xu Date: Thu, 10 Jan 2019 11:41:09 -0800 Subject: [PATCH] Slightly modify the comment in the test --- pkg/controller/garbagecollector/garbagecollector_test.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/pkg/controller/garbagecollector/garbagecollector_test.go b/pkg/controller/garbagecollector/garbagecollector_test.go index b382a3a185c..0543a5d6fbb 100644 --- a/pkg/controller/garbagecollector/garbagecollector_test.go +++ b/pkg/controller/garbagecollector/garbagecollector_test.go @@ -864,7 +864,12 @@ func TestGarbageCollectorSync(t *testing.T) { // gc.resyncMonitors() // controller.WaitForCacheSync() loops with `syncedPollPeriod` (hardcoded to 100ms), until either its stop channel is closed after `period`, or all caches synced. // - // Setting the period to 200ms allows the WaitForCacheSync() to check for cache sync ~2 times in every wait.PollImmediateUntil() loop. + // Setting the period to 200ms allows the WaitForCacheSync() to check + // for cache sync ~2 times in every wait.PollImmediateUntil() loop. + // + // The 1s sleep in the test allows GetDelableResources and + // gc.resyncMoitors to run ~5 times to ensure the changes to the + // fakeDiscoveryClient are picked up. go gc.Sync(fakeDiscoveryClient, 200*time.Millisecond, stopCh) // Wait until the sync discovers the initial resources