abseil-cpp
abseil-cpp copied to clipboard
[Bug]: //absl/random/internal:nanobenchmark_test usually fails on a machine with low timer counter resolution
Describe the issue
On a machine with a low enough timer counter resolution, such as Apple M2 (and I think M1), which has a 24 MHz resolution, this check usually fails:
https://github.com/abseil/abseil-cpp/blob/74058c0f49a06fa10b07e78f48d75b3569e9f51b/absl/random/internal/nanobenchmark.cc#L521
causing the test to fail. This is because the timer counter is unlikely to tick between when the test starts and when it ends.
Steps to reproduce the problem
bazel test //absl/random/internal:nanobenchmark_test on an M1 or M2 Mac running Fedora Asahi Remix or (untested) a Linux VM on macOS or directly on macOS.
What version of Abseil are you using?
0f102ad442efaea4df9f8fe66511314c71dff24f
What operating system and version are you using?
Linux (Fedora Asahi Remix 41)
What compiler and version are you using?
clang version 19.1.7 (Fedora 19.1.7-1.fc41)
What build system are you using?
bazel 8.0.1
Additional context
No response