-
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: benchmark timeout when benchtime set too long #49973
Comments
Change https://golang.org/cl/369294 mentions this issue: |
Duplicate of #12446 |
I agree that this might not be a duplicate - the code doesn't seem to be safe against overflows. That said, the fix doesn't seem complete. Not all overflows will result in negative numbers. |
Sorry, Is there any other cases? |
https://go.dev/play/p/MBFpdZOOSgx That example also has some better overflow detection that you can enable and try for yourself. Note that there are multiple operations involved in testing/benchmark.go, including multiplications and additions. Proper overflow checking won't be as trivial as in my example. |
Also, a fix would need to come with a test :) |
Done, see new PR #50023 |
Change https://golang.org/cl/372395 mentions this issue: |
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
yes
What did you do?
When benchmark function execute time is very short, set benchtime=5s / 10s / 20s is ok.
But set benchtime=120s will execute time out.
What did you expect to see?
Do not timeout
What did you see instead?
The text was updated successfully, but these errors were encountered: