Skip to content

Commit

Permalink
fix integer divide by zero panic
Browse files Browse the repository at this point in the history
  • Loading branch information
wgliang committed Jun 9, 2018
1 parent c46e8a9 commit 2417f95
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion test/integration/scheduler_perf/scheduler_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Expand Down

0 comments on commit 2417f95

Please sign in to comment.