-
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: Creating sub-benchmark with b.Run means that parent will not show anything from b.ReportMetric #66353
Comments
@aclements Was this effect an unexpected consequence of ResetTimer's clearing of the Should the |
@adonovan Any updates on this? 🤗 |
When I looked at the benchmark code, I was under the impression that this was expected, since if a benchmark has subbenchmarks, then it itself is not a benchmark and thus reports no metrics at all. |
@seankhliao It could be by design in the code. I got around it by not using sub-benchmarks at all. But in that case, maybe it should be documented? Or even better give an error when calling Run to create a sub-benchmark or ReportMetric on a sub-benchmark? Currently it happens without any notice. |
b.Run says:
|
Go version
go version go1.21.6 darwin/arm64
Output of
go env
in your module/workspace:What did you do?
What did you see happen?
What did you expect to see?
I want to see
some_metric
be reported on theBenchmarkTest/Test
benchmark.The text was updated successfully, but these errors were encountered: