From e4f6b144cf12ac6bb618a16bf57032fda4f2d312 Mon Sep 17 00:00:00 2001 From: Beata Skiba Date: Thu, 3 Aug 2017 12:25:30 +0200 Subject: [PATCH] Allow for some pods not to get scheduled in CA tests. This will allow us to ignore long tail node creation or failure to create some nodes when running scalability tests on kubemark. --- test/e2e/autoscaling/cluster_size_autoscaling.go | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/test/e2e/autoscaling/cluster_size_autoscaling.go b/test/e2e/autoscaling/cluster_size_autoscaling.go index 5b56675fae0..d2b75fc828d 100644 --- a/test/e2e/autoscaling/cluster_size_autoscaling.go +++ b/test/e2e/autoscaling/cluster_size_autoscaling.go @@ -966,7 +966,7 @@ func WaitForClusterSizeFuncWithUnready(c clientset.Interface, sizeFunc func(int) return fmt.Errorf("timeout waiting %v for appropriate cluster size", timeout) } -func waitForAllCaPodsReadyInNamespace(f *framework.Framework, c clientset.Interface) error { +func waitForCaPodsReadyInNamespace(f *framework.Framework, c clientset.Interface, tolerateUnreadyCount int) error { var notready []string for start := time.Now(); time.Now().Before(start.Add(scaleUpTimeout)); time.Sleep(20 * time.Second) { pods, err := c.Core().Pods(f.Namespace.Name).List(metav1.ListOptions{}) @@ -990,18 +990,22 @@ func waitForAllCaPodsReadyInNamespace(f *framework.Framework, c clientset.Interf notready = append(notready, pod.Name) } } - if len(notready) == 0 { - glog.Infof("All pods ready") + if len(notready) <= tolerateUnreadyCount { + glog.Infof("sufficient number of pods ready. Tolerating %d unready", tolerateUnreadyCount) return nil } - glog.Infof("Some pods are not ready yet: %v", notready) + glog.Infof("Too many pods are not ready yet: %v", notready) } glog.Info("Timeout on waiting for pods being ready") glog.Info(framework.RunKubectlOrDie("get", "pods", "-o", "json", "--all-namespaces")) glog.Info(framework.RunKubectlOrDie("get", "nodes", "-o", "json")) // Some pods are still not running. - return fmt.Errorf("Some pods are still not running: %v", notready) + return fmt.Errorf("Too many pods are still not running: %v", notready) +} + +func waitForAllCaPodsReadyInNamespace(f *framework.Framework, c clientset.Interface) error { + return waitForCaPodsReadyInNamespace(f, c, 0) } func getAnyNode(c clientset.Interface) *v1.Node {