aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoman Lebedev <lebedev.ri@gmail.com>2024-02-02 18:39:46 +0300
committerGitHub <noreply@github.com>2024-02-02 18:39:46 +0300
commitb04cec1bf90c3d8e47739bb3271607a18d8b5106 (patch)
tree799eae5a7ba4bce6277795806207e164ba3839c1
parente990563876ef92990e873dc5b479d3b79cda2547 (diff)
downloadgoogle-benchmark-b04cec1bf90c3d8e47739bb3271607a18d8b5106.tar.gz
Deflake CI (#1751)
* `complexity_test`: deflake, same as https://github.com/google/benchmark/issues/272 As it can be seen in e.g. https://github.com/google/benchmark/actions/runs/7711328637/job/21016492361 We may get `65: BM_Complexity_O1_BigO 0.00 N^2 0.00 N^2 ` * `user_counters_tabular_test`: deflake We were still getting zero times there. Perhaps this is better?
-rw-r--r--test/complexity_test.cc2
-rw-r--r--test/user_counters_tabular_test.cc2
2 files changed, 2 insertions, 2 deletions
diff --git a/test/complexity_test.cc b/test/complexity_test.cc
index 1248a53..1c746af 100644
--- a/test/complexity_test.cc
+++ b/test/complexity_test.cc
@@ -88,7 +88,7 @@ const char *enum_big_o_1 = "\\([0-9]+\\)";
// FIXME: Tolerate both '(1)' and 'lgN' as output when the complexity is auto
// deduced.
// See https://github.com/google/benchmark/issues/272
-const char *auto_big_o_1 = "(\\([0-9]+\\))|(lgN)";
+const char *auto_big_o_1 = "(\\([0-9]+\\))|(lgN)|(N\\^2)";
const char *lambda_big_o_1 = "f\\(N\\)";
// Add enum tests
diff --git a/test/user_counters_tabular_test.cc b/test/user_counters_tabular_test.cc
index e7ada65..3e8fb1b 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;