-
Notifications
You must be signed in to change notification settings - Fork 17.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
testing: fuzzing results include duplicate output #48884
Comments
Also, what is the minimization actually doing with 26 bytes? My input is one byte :) |
Thanks for filing this!
I think this is a duplicate of #48709, or at least will be fixed as a side effect once a fix is merged. If it's not, then we should look at this one again.
Same thing here. I think it's a dupe of #48709. If there is a crash, we re-run it at least 1 time to be sure it wasn't a flake, so that might be what you're seeing here as far as duplicate print statements.
I agree. We panic for most other
That's... a good question. Will look into this one. I have a suspicion of what might be going on here, but will double check. (It's possible we're printing the size of the marshaled corpus file, instead of the size of the unmarshaled value, which could explain where those extra 25 bytes are coming from) |
Thanks for the prompt reply! I thought some of these might be partial duplicates. I'm happy to give the reproducer another try after some fixes are merged. |
Hey @mvdan I just merged https://golang.org/cl/355909 which hopefully fixed this duplicate output issue. Would you be able to double check and see if this issue still reproduces for you? If not, you can close this. |
I can confirm that all three bugs appear to be fixed! Thanks for your work :) |
Woo! Great news 😄 |
If I then fuzz via
go test -fuzz=.
on an empty corpus, I get:I see multiple unexpected issues:
Note the two
parent f.Logf
lines. I suspect one of them is redundant. My actual fuzz func logged over a dozen times while callingf.Add
, so the duplication really added a lot of noise.I'm kinda confused why I see three separate
--- FAIL: FuzzFoo
blocks, all sharing the same input78
. Presumably the fuzzer should only test each input case once? If keeping track of all visited inputs or otherwise avoiding duplicates is too expensive, then at least we should be deduplicating the results being printed. To the end user, printing the same failure result more than once is unnecessary noise.Note how
child f.Logf
is allowed and ends up being printed along withparent f.Logf
. It is not allowed to callf.Fatalf
from inside the fuzz function taking a*testing.T
, so I think we should similarly disallow calling anytesting.TB
methods on the parent*testing.F
, such asLogf
. I actually usedf.Logf
instead oft.Logf
by mistake, and was very confused why my log lines ended up in the wrong position in the resulting failure output.These are three bugs into one, apologies :) I actually only intended to file number 3, but I ran into 1 and 2 while writing the reproducer. All three issues seem small and related enough to be OK within a single thread.
cc @katiehockman @jayconrod
The text was updated successfully, but these errors were encountered: