From a0c6a664a5ca9498492211eebf685535a9a67a10 Mon Sep 17 00:00:00 2001 From: Chao Xu Date: Thu, 18 Aug 2016 14:16:43 -0700 Subject: [PATCH] adjust waitForPodsInactive polling interval and timeout --- test/e2e/framework/util.go | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/test/e2e/framework/util.go b/test/e2e/framework/util.go index 69fd8a056d368..f061c263920f7 100644 --- a/test/e2e/framework/util.go +++ b/test/e2e/framework/util.go @@ -3131,7 +3131,22 @@ func DeleteRCAndWaitForGC(c *client.Client, ns, name string) error { } deleteRCTime := time.Now().Sub(startTime) Logf("Deleting RC %s took: %v", name, deleteRCTime) - err = waitForPodsInactive(ps, 10*time.Millisecond, 10*time.Minute) + var interval, timeout time.Duration + switch { + case rc.Spec.Replicas < 100: + interval = 10 * time.Millisecond + timeout = 10 * time.Minute + case rc.Spec.Replicas < 1000: + interval = 1 * time.Second + timeout = 10 * time.Minute + case rc.Spec.Replicas < 10000: + interval = 10 * time.Second + timeout = 10 * time.Minute + default: + interval = 10 * time.Second + timeout = 40 * time.Minute + } + err = waitForPodsInactive(ps, interval, timeout) if err != nil { return fmt.Errorf("error while waiting for pods to become inactive %s: %v", name, err) }