Merge pull request #68551 from bskiba/fix-e2e-small

Autoscaler e2e tests use allocatable to calculate resources
This commit is contained in:
k8s-ci-robot 2018-09-21 05:47:50 -07:00 committed by GitHub
commit 0d878e6252
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -115,8 +115,8 @@ var _ = SIGDescribe("Cluster size autoscaling [Slow]", func() {
nodeCount = len(nodes.Items) nodeCount = len(nodes.Items)
coreCount = 0 coreCount = 0
for _, node := range nodes.Items { for _, node := range nodes.Items {
quentity := node.Status.Capacity[v1.ResourceCPU] quantity := node.Status.Allocatable[v1.ResourceCPU]
coreCount += quentity.Value() coreCount += quantity.Value()
} }
By(fmt.Sprintf("Initial number of schedulable nodes: %v", nodeCount)) By(fmt.Sprintf("Initial number of schedulable nodes: %v", nodeCount))
Expect(nodeCount).NotTo(BeZero()) Expect(nodeCount).NotTo(BeZero())
@ -369,6 +369,9 @@ var _ = SIGDescribe("Cluster size autoscaling [Slow]", func() {
defer deleteNodePool(extraPoolName) defer deleteNodePool(extraPoolName)
extraNodes := getPoolInitialSize(extraPoolName) extraNodes := getPoolInitialSize(extraPoolName)
framework.ExpectNoError(framework.WaitForReadyNodes(c, nodeCount+extraNodes, resizeTimeout)) 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).") 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") 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)) Expect(len(nodes)).Should(Equal(extraNodes))
extraMemMb := 0 extraMemMb := 0
for _, node := range nodes { for _, node := range nodes {
mem := node.Status.Capacity[v1.ResourceMemory] mem := node.Status.Allocatable[v1.ResourceMemory]
extraMemMb += int((&mem).Value() / 1024 / 1024) extraMemMb += int((&mem).Value() / 1024 / 1024)
} }