-
Notifications
You must be signed in to change notification settings - Fork 18.8k
Closed
Closed
Copy link
Labels
FrozenDueToAgeNeedsFixThe path to resolution is known, but the work has not been done.The path to resolution is known, but the work has not been done.fuzzIssues related to native fuzzing supportIssues related to native fuzzing support
Milestone
Description
From #48884
func FuzzFoo(f *testing.F) {
f.Logf("parent f.Logf")
f.Fuzz(func(t *testing.T, n uint8) {
f.Logf("child f.Logf %d", n) // I'm allowed to use f.Logf here? f.Fatalf panics.
t.Logf("child t.Logf %d", n)
if n%3 == 0 {
t.Fatal("boom")
}
})
}
child f.Logf is allowed and ends up being printed along with parent f.Logf. It is not allowed to call f.Fatalf from inside the fuzz function taking a *testing.T, so I think we should similarly disallow calling any testing.TB methods on the parent *testing.F, such as Logf. I actually used f.Logf instead of t.Logf by mistake, and was very confused why my log lines ended up in the wrong position in the resulting failure output.
Let's disallow calls like f.Logf inside the f.Fuzz function, and encourage t.Logf and the like instead.
/cc @golang/fuzzing
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
FrozenDueToAgeNeedsFixThe path to resolution is known, but the work has not been done.The path to resolution is known, but the work has not been done.fuzzIssues related to native fuzzing supportIssues related to native fuzzing support
Type
Projects
Status
No status