Golang Fuzzing: Mismatched types in corpus entry

Viewed 133

When using the native fuzzing feature introduced in Go 1.18, after refactoring my tests, I now encounter the following error:

--- FAIL: FuzzTrie_InsertAndRead (0.03s)
    trie_test.go:340: "testdata/fuzz/FuzzTrie_InsertAndRead/84ed65595ad05a58e293dbf423c1a816b697e2763a29d7c37aa476d6eef6fd60":
    mismatched types in corpus entry: [[]uint8 []uint8], want [uint64 []uint8]

I assume this is due to the change of my test parameters from byte slices to a uint64 and a byte slice, but how can I get rid of this corpus data? Where is it located?

1 Answers

When running tests using native Go fuzzing, test data is generated and stored in the following path, relative to the tests that are being run: testdata/fuzz/<FuzzTestName>.

If a fuzz test changes name, the previous test data is therefore effectively unused, while if the types it uses are changed, the corpus data it contains is no longer of the relevant type, and can be discarded by removing the folder entirely.

Related