-
Notifications
You must be signed in to change notification settings - Fork 17.9k
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
go test -bench=.
with -benchtime=1x
is timing out at 2m and not running a single iteration of the benchmark
#71446
Comments
tests need to pass before benchmarks are run. Unlike many projects, the Go project does not use GitHub Issues for general discussion or asking questions. GitHub Issues are used for tracking bugs and proposals only. For questions please refer to https://github.com/golang/go/wiki/Questions |
Tests are failing due to an integer divide by zero that's happening due to the number of iterations that are running by the benchmarker ( This strikes me as a bug if I've asked the benchmarker to execute one run and it isn't doing that. |
a test |
It calls |
I think you'll have to show a simplified reproducer, the code your pointing at doesn't match your output (line numbers don't match), and a simple test of testing.Benchmark in a test function doesn't support b.N being 0. |
It does look like I pointed to the wrong line. Here's the line that's actually throwing the error. I did do a |
Oh! I think I figured it out, it's the |
Go version
go version go1.23.2 darwin/arm64
Output of
go env
in your module/workspace:What did you do?
Running
go test -bench=. -benchtime=1x
continually times out at 120s with the following error. My guess is that the test is not able to fully complete an iteration of the test function in this time, but I can't figure out why it's always timing out at 120s and it isn't able to fully complete an iteration of the benchmark function like I have asked it to do.What did you see happen?
The test benchmark function times-out indicating in
results.N
that it did not complete any iterations of the benchmark.What did you expect to see?
I expected
results.N
to say that it completed a single iteration no matter how long this benchmark took.The text was updated successfully, but these errors were encountered: