fix a flake of TestRoundTripTypes: for FirstAvailable[].AllocationMode

This commit is contained in:
Paco Xu
2025-03-10 11:10:23 +08:00
parent 0f2bde7745
commit ce163947aa

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 == "" {