diff --git a/test/e2e/autoscaling/cluster_size_autoscaling.go b/test/e2e/autoscaling/cluster_size_autoscaling.go index 62e493af1c..e9e0e542f0 100644 --- a/test/e2e/autoscaling/cluster_size_autoscaling.go +++ b/test/e2e/autoscaling/cluster_size_autoscaling.go @@ -115,8 +115,8 @@ var _ = SIGDescribe("Cluster size autoscaling [Slow]", func() { nodeCount = len(nodes.Items) coreCount = 0 for _, node := range nodes.Items { - quentity := node.Status.Capacity[v1.ResourceCPU] - coreCount += quentity.Value() + quantity := node.Status.Allocatable[v1.ResourceCPU] + coreCount += quantity.Value() } By(fmt.Sprintf("Initial number of schedulable nodes: %v", nodeCount)) Expect(nodeCount).NotTo(BeZero()) @@ -369,6 +369,9 @@ var _ = SIGDescribe("Cluster size autoscaling [Slow]", func() { defer deleteNodePool(extraPoolName) extraNodes := getPoolInitialSize(extraPoolName) framework.ExpectNoError(framework.WaitForReadyNodes(c, nodeCount+extraNodes, resizeTimeout)) + // We wait for nodes to become schedulable to make sure the new nodes + // will be returned by getPoolNodes below. + framework.ExpectNoError(framework.WaitForAllNodesSchedulable(c, resizeTimeout)) glog.Infof("Not enabling cluster autoscaler for the node pool (on purpose).") By("Getting memory available on new nodes, so we can account for it when creating RC") @@ -376,7 +379,7 @@ var _ = SIGDescribe("Cluster size autoscaling [Slow]", func() { Expect(len(nodes)).Should(Equal(extraNodes)) extraMemMb := 0 for _, node := range nodes { - mem := node.Status.Capacity[v1.ResourceMemory] + mem := node.Status.Allocatable[v1.ResourceMemory] extraMemMb += int((&mem).Value() / 1024 / 1024) }