Make webhook benchmarks parallel
Kubernetes-commit: 601b7d33a9cf0b724cdabb5de81b0bf2821f0fca
This commit is contained in:
parent
d04458daaa
commit
ce4eaaeeb3
|
|
@ -96,9 +96,11 @@ func BenchmarkAdmit(b *testing.B) {
|
|||
}
|
||||
|
||||
b.ResetTimer()
|
||||
for i := 0; i < b.N; i++ {
|
||||
wh.Admit(context.TODO(), attr, objectInterfaces)
|
||||
}
|
||||
b.RunParallel(func(pb *testing.PB) {
|
||||
for pb.Next() {
|
||||
wh.Admit(context.TODO(), attr, objectInterfaces)
|
||||
}
|
||||
})
|
||||
})
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -85,9 +85,11 @@ func BenchmarkValidate(b *testing.B) {
|
|||
attr := webhooktesting.NewAttribute(ns, nil, tt.IsDryRun)
|
||||
|
||||
b.ResetTimer()
|
||||
for i := 0; i < b.N; i++ {
|
||||
wh.Validate(context.TODO(), attr, objectInterfaces)
|
||||
}
|
||||
b.RunParallel(func(pb *testing.PB) {
|
||||
for pb.Next() {
|
||||
wh.Validate(context.TODO(), attr, objectInterfaces)
|
||||
}
|
||||
})
|
||||
})
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue