You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
testing: prevent (*testing.F) methods from being called inside (*testing.F).Fuzz fn #48988
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.
Activity
gopherbot commentedon Oct 15, 2021
Change https://golang.org/cl/356151 mentions this issue:
testing: don't allow f.Log/Logf inside f.Fuzztesting: don't allow f.Log/Logf or f.Skipped inside f.Fuzz