-
Notifications
You must be signed in to change notification settings - Fork 17.7k
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
cmd/go: fuzzing output adjustments #48132
Comments
I see now that the header does happen with -v, just not without -v. |
Watching the output more, it would help to use d.Round(1*time.Second).String() to format the elapsed duration d, instead of printing number of seconds. It gets tiring to do the mental math on lines like
Duration.String would say 23m9s instead. |
Change https://golang.org/cl/349970 mentions this issue: |
Thanks for the fixes. Looks like one was missed as far as the prefix:
I would suggest making this a bit closer to the status messages, like
or something like that. I'm not sure what the 'left: 4178' means exactly, so the suggested rewrite may not be any good on that front. It seems like there should be a second one of those prints when it's completely done with the corpus, or whatever 'left: 0' would mean. While I'm nitpicking:
would be more concise and I think equally clear as
(perhaps with the elapsed time as in the others?). I'm also not sure about the word 'crash' here, since in my case they are t.Fail inputs. There is no actual crash. Similarly, perhaps 'Crash written to ...' should be 'Failure input written to ...' |
And does the number of workers ever change? Maybe it should just be printed once instead of in every message?
|
Will fix this, and the other nits! 👍
Nope. We can probably just print it once at the start. As for the use of "crash", that's the verbiage we've been using throughout our documentation and blog posts so far to indicating any kind of failure that is found during fuzzing. It's also something that's used in a lot of other documentation around the web about fuzzing (like libfuzzer's |
@jayconrod suggested keeping the |
Change https://golang.org/cl/350997 mentions this issue: |
Change https://golang.org/cl/351273 mentions this issue: |
This change also makes it so that non-recoverable errors (which should be pretty rare) will no longer be minimized as these failures can be flakier and harder to minimize successfully. Updates #48132 Change-Id: I991d837993ea1fb0304b3ec491cc725ef5265652 Reviewed-on: https://go-review.googlesource.com/c/go/+/351273 Trust: Katie Hockman <katie@golang.org> Run-TryBot: Katie Hockman <katie@golang.org> TryBot-Result: Go Bot <gobot@golang.org> Reviewed-by: Jay Conrod <jayconrod@google.com>
Thanks for the fixes. Using crasher is OK but we need to define it clearly in the docs (in package testing and also in reference docs), since it doesn't mean what it looks like. |
Change https://go.dev/cl/443596 mentions this issue: |
Test2json is parsing the output stream from the test, which includes package testing's own framing lines intermingled with other output, in particular any output printed via fmt.Printf, println, and so on. We have had recurring problems with unexpected partial output lines causing a framing line to be missed. A recent talk at GopherCon gave an example of an integration test involving Docker that happened to print \r-terminated lines instead of \n-terminated lines in some configurations, which in turn broke test2json badly. (https://www.gophercon.com/agenda/session/944259) There are also a variety of open reported issues with similar problems, which this CL also addresses. The general approach is to add a new testing flag -test.v=json that means to print additional output to help test2json. And then test2json takes advantage of that output. Among the fixes: - Identify testing framing more reliably, using ^V (#23036, #26325, #43683, GopherCon talk) - Test that output with \r\n endings is handled correctly (#43683, #34286) - Use === RUN in fuzz tests (#52636, #48132) - Add === RUN lines to note benchmark starts (#27764, #49505) - Print subtest --- PASS/FAIL lines as they happen (#29811) - Add === NAME lines to emit more test change events, such as when a subtest stops and the parent continues running. - Fix event shown in overall test failure (#27568) - Avoid interleaving of writes to os.Stdout and os.Stderr (#33419) Fixes #23036. Fixes #26325. Fixes #27568. Fixes #27764. Fixes #29811. Fixes #33419. Fixes #34286. Fixes #43683. Fixes #49505. Fixes #52636. Change-Id: Id4207b746a20693f92e52d68c6e4a7f8c41cc7c6 Reviewed-on: https://go-review.googlesource.com/c/go/+/443596 Auto-Submit: Russ Cox <rsc@golang.org> Run-TryBot: Russ Cox <rsc@golang.org> Reviewed-by: Bryan Mills <bcmills@google.com> TryBot-Result: Gopher Robot <gobot@golang.org>
Test2json is parsing the output stream from the test, which includes package testing's own framing lines intermingled with other output, in particular any output printed via fmt.Printf, println, and so on. We have had recurring problems with unexpected partial output lines causing a framing line to be missed. A recent talk at GopherCon gave an example of an integration test involving Docker that happened to print \r-terminated lines instead of \n-terminated lines in some configurations, which in turn broke test2json badly. (https://www.gophercon.com/agenda/session/944259) There are also a variety of open reported issues with similar problems, which this CL also addresses. The general approach is to add a new testing flag -test.v=json that means to print additional output to help test2json. And then test2json takes advantage of that output. Among the fixes: - Identify testing framing more reliably, using ^V (golang#23036, golang#26325, golang#43683, GopherCon talk) - Test that output with \r\n endings is handled correctly (golang#43683, golang#34286) - Use === RUN in fuzz tests (golang#52636, golang#48132) - Add === RUN lines to note benchmark starts (golang#27764, golang#49505) - Print subtest --- PASS/FAIL lines as they happen (golang#29811) - Add === NAME lines to emit more test change events, such as when a subtest stops and the parent continues running. - Fix event shown in overall test failure (golang#27568) - Avoid interleaving of writes to os.Stdout and os.Stderr (golang#33419) Fixes golang#23036. Fixes golang#26325. Fixes golang#27568. Fixes golang#27764. Fixes golang#29811. Fixes golang#33419. Fixes golang#34286. Fixes golang#43683. Fixes golang#49505. Fixes golang#52636. Change-Id: Id4207b746a20693f92e52d68c6e4a7f8c41cc7c6 Reviewed-on: https://go-review.googlesource.com/c/go/+/443596 Auto-Submit: Russ Cox <rsc@golang.org> Run-TryBot: Russ Cox <rsc@golang.org> Reviewed-by: Bryan Mills <bcmills@google.com> TryBot-Result: Gopher Robot <gobot@golang.org>
The current chatty fuzzing output should be more amenable to processing with test2json. There are only minor changes needed:
/cc @jayconrod @katiehockman
The text was updated successfully, but these errors were encountered: