From 8a7e6f6852740e989ef8f679db5631306466a4ed Mon Sep 17 00:00:00 2001 From: tomoya ishida Date: Thu, 15 Aug 2024 15:55:57 +0900 Subject: [PATCH] Improve base time of assert_linear_performance (#11369) Remove `.ceil` from base time calculation that makes 10x gap. This will make the assertion more strict and also less flaky. --- tool/lib/core_assertions.rb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tool/lib/core_assertions.rb b/tool/lib/core_assertions.rb index b456a55b34..361b1a697d 100644 --- a/tool/lib/core_assertions.rb +++ b/tool/lib/core_assertions.rb @@ -825,7 +825,9 @@ eom end times.compact! tmin, tmax = times.minmax - tbase = 10 ** Math.log10(tmax * ([(tmax / tmin), 2].max ** 2)).ceil + + # safe_factor * tmax * rehearsal_time_variance_factor(equals to 1 when variance is small) + tbase = 10 * tmax * [(tmax / tmin) ** 2 / 4, 1].max info = "(tmin: #{tmin}, tmax: #{tmax}, tbase: #{tbase})" seq.each do |i|