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.
This commit is contained in:
tomoya ishida 2024-08-15 15:55:57 +09:00 committed by Hiroshi SHIBATA
parent af17a34c88
commit b33c331184

View file

@ -768,7 +768,9 @@ eom
end end
times.compact! times.compact!
tmin, tmax = times.minmax 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})" info = "(tmin: #{tmin}, tmax: #{tmax}, tbase: #{tbase})"
seq.each do |i| seq.each do |i|