Skip to content

benchmark timeout when benchtime set too long #49950

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

Closed
wants to merge 3 commits into from

Conversation

lkxiaolou
Copy link

@lkxiaolou lkxiaolou commented Dec 3, 2021

When benchmark function execute time is very short, set benchtime=5s / 10s / 20s is ok.

BenchmarkNewObject-2            1000000000               0.279 ns/op

But set benchtime=120s will execute time out.

*** Test killed with quit: ran too long (11m0s).

image

  1. benchtime short
    The B.n maybe 1 , 100 , 10000, 1000000, 100000000, 100000000 and exist.

  2. benchtime long
    But set benchtime=120s, n = goalns * prevIters / prevns may be overflow(< 0) int64, and the B.n maybe 1, 100, 10000, 1000000, 100000000, 100000001, 100000002 .... and timeout.

@google-cla google-cla bot added the cla: no Used by googlebot to label PRs as having an invalid CLA. The text of this label should not change. label Dec 3, 2021
@lkxiaolou lkxiaolou changed the title Fix benchmark timeout when benchtime set too long Fix #49973 benchmark timeout when benchtime set too long Dec 4, 2021
@lkxiaolou lkxiaolou closed this Dec 4, 2021
@lkxiaolou lkxiaolou reopened this Dec 4, 2021
@lkxiaolou lkxiaolou closed this Dec 4, 2021
@lkxiaolou lkxiaolou changed the title Fix #49973 benchmark timeout when benchtime set too long benchmark timeout when benchtime set too long Dec 7, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla: no Used by googlebot to label PRs as having an invalid CLA. The text of this label should not change.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant