Merge pull request #64363 from idealhack/sub-benchmarks/scheduler/schedulercache

Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

scheduler: update tests to use sub-benchmarks (pkg/scheduler/cache)

**What this PR does / why we need it**:

Go 1.7 added the subtest feature which can make table-driven tests much easier to run and debug. Some tests are not using this feature.

Further reading: [Using Subtests and Sub-benchmarks](https://blog.golang.org/subtests)

/kind cleanup

**Release note**:

```release-note
NONE
```
This commit is contained in:
Kubernetes Submit Queue 2018-07-01 19:04:19 -07:00 committed by GitHub
commit f2db955b9d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1128,16 +1128,18 @@ func BenchmarkUpdate1kNodes30kPods(b *testing.B) {
} }
} }
func BenchmarkExpire100Pods(b *testing.B) { func BenchmarkExpirePods(b *testing.B) {
benchmarkExpire(b, 100) podNums := []int{
100,
1000,
10000,
} }
for _, podNum := range podNums {
func BenchmarkExpire1kPods(b *testing.B) { name := fmt.Sprintf("%dPods", podNum)
benchmarkExpire(b, 1000) b.Run(name, func(b *testing.B) {
benchmarkExpire(b, podNum)
})
} }
func BenchmarkExpire10kPods(b *testing.B) {
benchmarkExpire(b, 10000)
} }
func benchmarkExpire(b *testing.B, podNum int) { func benchmarkExpire(b *testing.B, podNum int) {