Merge pull request #130675 from pacoxu/fix-ut-flake

fix a flake of TestRoundTripTypes: for FirstAvailable[].AllocationMode
This commit is contained in:
Kubernetes Prow Robot 2025-03-10 11:55:54 -07:00 committed by GitHub
commit 9b57a960f8
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -39,6 +39,15 @@ var Funcs = func(codecs runtimeserializer.CodecFactory) []interface{} {
}[c.Int31n(2)]
}
},
func(r *resource.DeviceSubRequest, c randfill.Continue) {
c.FillNoCustom(r) // fuzz self without calling this function again
if r.AllocationMode == "" {
r.AllocationMode = []resource.DeviceAllocationMode{
resource.DeviceAllocationModeAll,
resource.DeviceAllocationModeExactCount,
}[c.Int31n(2)]
}
},
func(r *resource.DeviceAllocationConfiguration, c randfill.Continue) {
c.FillNoCustom(r)
if r.Source == "" {