mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-01 07:47:56 +00:00
Precalculate String() for fuzzed Quantity
Avoids biasing serialization results where the value is assumed to be in canonical form already.
This commit is contained in:
parent
a9c3edc613
commit
a24936355e
@ -195,6 +195,8 @@ func FuzzerFor(t *testing.T, version unversioned.GroupVersion, src rand.Source)
|
||||
randomQuantity := func() resource.Quantity {
|
||||
var q resource.Quantity
|
||||
c.Fuzz(&q)
|
||||
// precalc the string for benchmarking purposes
|
||||
_ = q.String()
|
||||
return q
|
||||
}
|
||||
q.Limits = make(api.ResourceList)
|
||||
|
Loading…
Reference in New Issue
Block a user