What is the Go build cache for fuzz testing?

247 views
Skip to first unread message

will....@gmail.com

unread,
Apr 26, 2022, 8:36:49 PM4/26/22
to golang-nuts
`go help clean` says:

The -fuzzcache flag causes clean to remove files stored in the Go build
cache for fuzz testing. The fuzzing engine caches files that expand
code coverage, so removing them may make fuzzing less effective until
new inputs are found that provide the same coverage. These files are
distinct from those stored in testdata directory; clean does not remove
those files.


What's the difference between the fuzz cache in the testdata/fuzz directory in your own package, and this "Go build cache for fuzz testing"? Is it duplicating testdata/fuzz per package? And where is it?

Sean Liao

unread,
Apr 27, 2022, 5:28:08 AM4/27/22
to golang-nuts
testdata/fuzz is for inputs that have caused a failure and you want to keep around so that they are ~always run, to prevent regressions.
-fuzzcache is more like a log of useful things it has tried, so it doesn't waste resources going over the same/similar inputs
see `go help cache`

- sean


--
You received this message because you are subscribed to the Google Groups "golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/golang-nuts/3a699718-196f-48b8-a414-19f6d8835d35n%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages