• Kubernetes Submit Queue's avatar
    Merge pull request #37823 from danwinship/better-fuzzing · 723a200c
    Kubernetes Submit Queue authored
    Automatic merge from submit-queue (batch tested with PRs 38049, 37823, 38000, 36646)
    
    Test 0-length-arrays in fuzzing tests
    
    While hacking on #37289 I noticed that our fuzzing tests test nil slices and slices of length 1, but not slices of length 0, meaning we aren't testing that 0-length slices get treated the same as nil in all the places we expect them to (and in particular, we aren't ensuring that comparisons always use api.Semantic.DeepEqual rather than reflect.DeepEqual). (Though in fact, changing the fuzzer didn't turn up any bugs, so maybe this effectively gets tested somewhere else...)
    
    `fuzz.New().NilChance(.5).NumElements(0, 1)` means we end up generating `nil` 50% of the time, a length 0 array 25% of the time, and a length 1 array 25% of the time... maybe it should be `fuzz.New().NilChance(.33).NumElements(0, 1)` instead?
    
    The gofuzz rebase is to pull in https://github.com/google/gofuzz/pull/20, and the other fix is just a drive-by.
    723a200c
Name
Last commit
Last update
..
annotations Loading commit data...
endpoints Loading commit data...
errors Loading commit data...
events Loading commit data...
install Loading commit data...
meta Loading commit data...
pod Loading commit data...
resource Loading commit data...
rest Loading commit data...
service Loading commit data...
testapi Loading commit data...
testing Loading commit data...
unversioned Loading commit data...
util Loading commit data...
v1 Loading commit data...
validation Loading commit data...
BUILD Loading commit data...
OWNERS Loading commit data...
context.go Loading commit data...
context_test.go Loading commit data...
conversion.go Loading commit data...
conversion_test.go Loading commit data...
copy_test.go Loading commit data...
deep_copy_test.go Loading commit data...
defaulting_test.go Loading commit data...
defaults.go Loading commit data...
doc.go Loading commit data...
field_constants.go Loading commit data...
generate.go Loading commit data...
generate_test.go Loading commit data...
helpers.go Loading commit data...
helpers_test.go Loading commit data...
mapper.go Loading commit data...
meta.go Loading commit data...
meta_test.go Loading commit data...
node_example.json Loading commit data...
ref.go Loading commit data...
ref_test.go Loading commit data...
register.go Loading commit data...
replication_controller_example.json Loading commit data...
requestcontext.go Loading commit data...
resource_helpers.go Loading commit data...
resource_helpers_test.go Loading commit data...
serialization_proto_test.go Loading commit data...
serialization_test.go Loading commit data...
types.generated.go Loading commit data...
types.go Loading commit data...
zz_generated.deepcopy.go Loading commit data...