mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-07 11:13:48 +00:00
fix integer divide by zero panic
This commit is contained in:
parent
c46e8a9248
commit
2417f95308
@ -162,8 +162,12 @@ func schedulePods(config *testConfig) int32 {
|
||||
// return the worst-case-scenario interval that was seen during this time.
|
||||
// Note this should never be low due to cold-start, so allow bake in sched time if necessary.
|
||||
if len(scheduled) >= config.numPods {
|
||||
consumed := int(time.Since(start) / time.Second)
|
||||
if consumed <= 0 {
|
||||
consumed = 1
|
||||
}
|
||||
fmt.Printf("Scheduled %v Pods in %v seconds (%v per second on average). min QPS was %v\n",
|
||||
config.numPods, int(time.Since(start)/time.Second), config.numPods/int(time.Since(start)/time.Second), minQps)
|
||||
config.numPods, consumed, config.numPods/consumed, minQps)
|
||||
return minQps
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user