diff options
author | Roman Lebedev <lebedev.ri@gmail.com> | 2024-02-19 18:22:35 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-02-19 15:22:35 +0000 |
commit | 3d85343d65832d05b4dcd6666640e0e38b981c33 (patch) | |
tree | cca0bc301d71825efff0aeaedfebee61cff87a26 /test/skip_with_error_test.cc | |
parent | 7f7c96a26497a380b63259be928bbe29394ef2ae (diff) | |
download | google-benchmark-3d85343d65832d05b4dcd6666640e0e38b981c33.tar.gz |
Rewrite complexity_test to use (hardcoded) manual time (#1757)
* Rewrite complexity_test to use (hardcoded) manual time
This test is fundamentally flaky, because it tried to read tea leafs,
and is inherently misbehaving in CI environments,
since there are unmitigated sources of noise.
That being said, the computed Big-O also depends on the `--benchmark_min_time=`
Fixes https://github.com/google/benchmark/issues/272
* Correctly compute Big-O for manual timings. Fixes #1758.
* complexity_test: do more stuff in empty loop
* Make all empty loops be a bit longer empty
Looks like on windows, some of these tests still fail,
i guess clock precision is too small.
Diffstat (limited to 'test/skip_with_error_test.cc')
-rw-r--r-- | test/skip_with_error_test.cc | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/test/skip_with_error_test.cc b/test/skip_with_error_test.cc index b4c5e15..2139a19 100644 --- a/test/skip_with_error_test.cc +++ b/test/skip_with_error_test.cc @@ -143,7 +143,7 @@ ADD_CASES("BM_error_during_running_ranged_for", void BM_error_after_running(benchmark::State& state) { for (auto _ : state) { - auto iterations = state.iterations(); + auto iterations = double(state.iterations()) * double(state.iterations()); benchmark::DoNotOptimize(iterations); } if (state.thread_index() <= (state.threads() / 2)) |