mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-09-15 14:14:39 +00:00
Wait for instances boot in cluster-autoscaler e2e
This commit is contained in:
@@ -79,14 +79,6 @@ var _ = framework.KubeDescribe("Cluster size autoscaling [Slow]", func() {
|
|||||||
c = f.ClientSet
|
c = f.ClientSet
|
||||||
framework.SkipUnlessProviderIs("gce", "gke")
|
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)
|
originalSizes = make(map[string]int)
|
||||||
sum := 0
|
sum := 0
|
||||||
for _, mig := range strings.Split(framework.TestContext.CloudConfig.NodeInstanceGroup, ",") {
|
for _, mig := range strings.Split(framework.TestContext.CloudConfig.NodeInstanceGroup, ",") {
|
||||||
@@ -96,6 +88,17 @@ var _ = framework.KubeDescribe("Cluster size autoscaling [Slow]", func() {
|
|||||||
originalSizes[mig] = size
|
originalSizes[mig] = size
|
||||||
sum += 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))
|
Expect(nodeCount).Should(Equal(sum))
|
||||||
|
|
||||||
if framework.ProviderIs("gke") {
|
if framework.ProviderIs("gke") {
|
||||||
|
Reference in New Issue
Block a user