diff options
| author | nagachika <nagachika@ruby-lang.org> | 2024-08-31 18:48:17 +0900 |
|---|---|---|
| committer | nagachika <nagachika@ruby-lang.org> | 2024-08-31 18:48:17 +0900 |
| commit | 07d7ffeb9c2c6537883a1ea7b180eb04ecbe47e6 (patch) | |
| tree | dcc7f0f32d83a3ac1be4bb002f97ecec1e59a013 | |
| parent | 00fada3890fe7bebbd660af3682eee6a8857b222 (diff) | |
merge revision(s) 3fe134759cc4904c74306e0832c22fa518a5bea2:
Skip assert_linear_performance for RJIT
| -rw-r--r-- | tool/lib/core_assertions.rb | 7 | ||||
| -rw-r--r-- | version.h | 2 |
2 files changed, 6 insertions, 3 deletions
diff --git a/tool/lib/core_assertions.rb b/tool/lib/core_assertions.rb index 9842fac8f7..6000d39c90 100644 --- a/tool/lib/core_assertions.rb +++ b/tool/lib/core_assertions.rb @@ -744,13 +744,16 @@ eom # # :yield: each elements of +seq+. def assert_linear_performance(seq, rehearsal: nil, pre: ->(n) {n}) + # Timeout testing generally doesn't work when RJIT compilation happens. + rjit_enabled = defined?(RubyVM::RJIT) && RubyVM::RJIT.enabled? + first = seq.first *arg = pre.call(first) times = (0..(rehearsal || (2 * first))).map do st = Process.clock_gettime(Process::CLOCK_MONOTONIC) yield(*arg) t = (Process.clock_gettime(Process::CLOCK_MONOTONIC) - st) - assert_operator 0, :<=, t + assert_operator 0, :<=, t unless rjit_enabled t.nonzero? end times.compact! @@ -766,7 +769,7 @@ eom Timeout.timeout(t, Timeout::Error, message) do st = Process.clock_gettime(Process::CLOCK_MONOTONIC) yield(*arg) - assert_operator (Process.clock_gettime(Process::CLOCK_MONOTONIC) - st), :<=, t, message + assert_operator (Process.clock_gettime(Process::CLOCK_MONOTONIC) - st), :<=, t, message unless rjit_enabled end end end @@ -11,7 +11,7 @@ # define RUBY_VERSION_MINOR RUBY_API_VERSION_MINOR #define RUBY_VERSION_TEENY 5 #define RUBY_RELEASE_DATE RUBY_RELEASE_YEAR_STR"-"RUBY_RELEASE_MONTH_STR"-"RUBY_RELEASE_DAY_STR -#define RUBY_PATCHLEVEL 215 +#define RUBY_PATCHLEVEL 216 #include "ruby/version.h" #include "ruby/internal/abi.h" |
