From e9df833223bc551b9caf2b839435c8c558b665c4 Mon Sep 17 00:00:00 2001 From: Roman Lebedev Date: Fri, 2 Feb 2024 00:40:10 +0300 Subject: [PATCH] `user_counters_tabular_test`: deflake We were still getting zero times there. Perhaps this is better? --- test/user_counters_tabular_test.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/user_counters_tabular_test.cc b/test/user_counters_tabular_test.cc index e7ada657b2..3e8fb1bf00 100644 --- a/test/user_counters_tabular_test.cc +++ b/test/user_counters_tabular_test.cc @@ -372,7 +372,7 @@ CHECK_BENCHMARK_RESULTS("BM_Counters_Tabular/repeats:2/threads:2$", void BM_CounterRates_Tabular(benchmark::State& state) { for (auto _ : state) { // This test requires a non-zero CPU time to avoid divide-by-zero - auto iterations = state.iterations(); + auto iterations = double(state.iterations()) * double(state.iterations()); benchmark::DoNotOptimize(iterations); } namespace bm = benchmark;