mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-04 01:40:07 +00:00
Make webhook benchmarks parallel
This commit is contained in:
parent
8b4fd4104d
commit
601b7d33a9
@ -96,9 +96,11 @@ func BenchmarkAdmit(b *testing.B) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
b.ResetTimer()
|
b.ResetTimer()
|
||||||
for i := 0; i < b.N; i++ {
|
b.RunParallel(func(pb *testing.PB) {
|
||||||
wh.Admit(context.TODO(), attr, objectInterfaces)
|
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)
|
attr := webhooktesting.NewAttribute(ns, nil, tt.IsDryRun)
|
||||||
|
|
||||||
b.ResetTimer()
|
b.ResetTimer()
|
||||||
for i := 0; i < b.N; i++ {
|
b.RunParallel(func(pb *testing.PB) {
|
||||||
wh.Validate(context.TODO(), attr, objectInterfaces)
|
for pb.Next() {
|
||||||
}
|
wh.Validate(context.TODO(), attr, objectInterfaces)
|
||||||
|
}
|
||||||
|
})
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user