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
[dev.fuzz] proposal: default timeout should be disabled #44483
Comments
The current proposal mentions a possible |
The description for What I'm not sure about is what to do if someone does something like this: Perhaps |
I suggest that timeout should be also applied to fuzzing but use the default 0 instead 10 minutes. If a timeout value is provided it should be used for testing and fuzzing. This way we can avoid -fuzztime and all confusion resulting from it. To be honest users will not care for tests on the seed corpus and timeouts on it. For me it was always stuff in a directory. I started often with one simple seed. What was important to me where the crashers, because I needed them to create the test cases for the required fixes. |
I think there needs to be one other timeout: timeout for one fuzz function invocation. This will allow one to find not only crashers, but hangs due to endless loops, large memory consumption, blocking on reading, etc. https://github.com/dvyukov/go-fuzz has this flag:
I think we can redefine what |
As a user, I respectfully disagree. I used unit tests for filling seed corpus even before |
Change https://golang.org/cl/313072 mentions this issue: |
This issue is focused on two main points: 1) the default timeout should be disabled when fuzzing and 2) we should consider a way to specify how long an execution of a fuzz function can run before it should be considered a "crash". https://golang.org/cl/313072 fixes (1), and I'll track (2) in my list of feature requests/bugs to be filed all at once in a few weeks. |
The -timeout flag is not used when the fuzzing engine is running, but there was another backup alarm that would stop the test binary after 11 minutes by default. This change disables that backup alarm when the -fuzz flag is set. Note: unfortunately this means that if someone is running `go test -fuzz` and a test hangs before the fuzzing engine starts running, then the backup alarm won't trigger and the test will run ~forever. I don't think there's a way around this though, since the backup alarm has no way of knowing what stage of the test execution we're in (ie. are we running the unit tests, the seed corpus, or is it fuzzing). Fixes #44483 Change-Id: I4e212708a739c9cfc2e138440e27f257bb408c7f Reviewed-on: https://go-review.googlesource.com/c/go/+/313072 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>
I have filed #46220, so will go ahead and close this one as fixed. |
Running the following flags:
eventually crashes with:
I would expect the use of the
fuzz
flag to implicitly disable thetimeout
flag (i.e., set it to0
). The fact that it crashes after around 10min matches the default value fortimeout
, which is 10min. I'm not sure where the additional 60s comes from.The text was updated successfully, but these errors were encountered: