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 GitHub
parent a1d8ef6ebf
commit 8a7e6f6852
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
Notes: git 2024-08-15 06:56:22 +00:00
Merged-By: kou <kou@clear-code.com>

View File

@ -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|