Fix golint failures for test/e2e/scalability

This commit is contained in:
Andrea Nodari 2019-05-20 15:14:16 +02:00
parent 3bd11af6a1
commit 35f6ad187b

View File

@ -402,7 +402,7 @@ var _ = SIGDescribe("Density", func() {
var uuid string var uuid string
var e2eStartupTime time.Duration var e2eStartupTime time.Duration
var totalPods int var totalPods int
var nodeCpuCapacity int64 var nodeCPUCapacity int64
var nodeMemCapacity int64 var nodeMemCapacity int64
var nodes *v1.NodeList var nodes *v1.NodeList
var scheduleThroughputs []float64 var scheduleThroughputs []float64
@ -508,7 +508,7 @@ var _ = SIGDescribe("Density", func() {
gomega.Expect(nodeCount).NotTo(gomega.BeZero()) gomega.Expect(nodeCount).NotTo(gomega.BeZero())
// Compute node capacity, leaving some slack for addon pods. // Compute node capacity, leaving some slack for addon pods.
nodeCpuCapacity = nodes.Items[0].Status.Allocatable.Cpu().MilliValue() - 100 nodeCPUCapacity = nodes.Items[0].Status.Allocatable.Cpu().MilliValue() - 100
nodeMemCapacity = nodes.Items[0].Status.Allocatable.Memory().Value() - 100*1024*1024 nodeMemCapacity = nodes.Items[0].Status.Allocatable.Memory().Value() - 100*1024*1024
// Terminating a namespace (deleting the remaining objects from it - which // Terminating a namespace (deleting the remaining objects from it - which
@ -691,7 +691,7 @@ var _ = SIGDescribe("Density", func() {
Timeout: timeout, Timeout: timeout,
PodStatusFile: fileHndl, PodStatusFile: fileHndl,
Replicas: (totalPods + numberOfCollections - 1) / numberOfCollections, Replicas: (totalPods + numberOfCollections - 1) / numberOfCollections,
CpuRequest: nodeCpuCapacity / 100, CpuRequest: nodeCPUCapacity / 100,
MemRequest: nodeMemCapacity / 100, MemRequest: nodeMemCapacity / 100,
MaxContainerFailures: &MaxContainerFailures, MaxContainerFailures: &MaxContainerFailures,
Silent: true, Silent: true,
@ -851,7 +851,7 @@ var _ = SIGDescribe("Density", func() {
// Thanks to it we trigger increasing priority function by scheduling // Thanks to it we trigger increasing priority function by scheduling
// a pod to a node, which in turn will result in spreading latency pods // a pod to a node, which in turn will result in spreading latency pods
// more evenly between nodes. // more evenly between nodes.
cpuRequest := *resource.NewMilliQuantity(nodeCpuCapacity/5, resource.DecimalSI) cpuRequest := *resource.NewMilliQuantity(nodeCPUCapacity/5, resource.DecimalSI)
memRequest := *resource.NewQuantity(nodeMemCapacity/5, resource.DecimalSI) memRequest := *resource.NewQuantity(nodeMemCapacity/5, resource.DecimalSI)
if podsPerNode > 30 { if podsPerNode > 30 {
// This is to make them schedulable on high-density tests // This is to make them schedulable on high-density tests