Merge pull request #47005 from MaciekPytel/add_e2e_setup_time

Automatic merge from submit-queue (batch tested with PRs 46977, 47005, 47018, 47061, 46809)

Fix for cluster-autoscaler e2e failures

This may help with cluster-autoscaler e2e failing in setup if the tests are run before all machines in mig get fully ready.
This commit is contained in:
Kubernetes Submit Queue 2017-06-07 08:10:40 -07:00 committed by GitHub
commit e7bb6af46c

View File

@ -79,14 +79,6 @@ var _ = framework.KubeDescribe("Cluster size autoscaling [Slow]", func() {
c = f.ClientSet
framework.SkipUnlessProviderIs("gce", "gke")
nodes := framework.GetReadySchedulableNodesOrDie(f.ClientSet)
nodeCount = len(nodes.Items)
Expect(nodeCount).NotTo(BeZero())
cpu := nodes.Items[0].Status.Capacity[v1.ResourceCPU]
mem := nodes.Items[0].Status.Capacity[v1.ResourceMemory]
coresPerNode = int((&cpu).MilliValue() / 1000)
memCapacityMb = int((&mem).Value() / 1024 / 1024)
originalSizes = make(map[string]int)
sum := 0
for _, mig := range strings.Split(framework.TestContext.CloudConfig.NodeInstanceGroup, ",") {
@ -96,6 +88,17 @@ var _ = framework.KubeDescribe("Cluster size autoscaling [Slow]", func() {
originalSizes[mig] = size
sum += size
}
// Give instances time to spin up
framework.ExpectNoError(framework.WaitForClusterSize(c, sum, scaleUpTimeout))
nodes := framework.GetReadySchedulableNodesOrDie(f.ClientSet)
nodeCount = len(nodes.Items)
Expect(nodeCount).NotTo(BeZero())
cpu := nodes.Items[0].Status.Capacity[v1.ResourceCPU]
mem := nodes.Items[0].Status.Capacity[v1.ResourceMemory]
coresPerNode = int((&cpu).MilliValue() / 1000)
memCapacityMb = int((&mem).Value() / 1024 / 1024)
Expect(nodeCount).Should(Equal(sum))
if framework.ProviderIs("gke") {