summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorTakashi Kokubun <takashikkbn@gmail.com>2023-11-03 22:18:15 -0700
committerTakashi Kokubun <takashikkbn@gmail.com>2023-11-03 22:18:16 -0700
commit9f95b6eb5d3458cc79668afd24b0b10c161d7d84 (patch)
tree45aae0fd258b5a05137acafda8a17bd395de46e5 /test
parent6b2a3c84a5a6f06841a277439052ca17a4c65e08 (diff)
Skip a test that is flaky with RJIT
It's crashing inside the bug reporter after a crash, so not sure why it's crashing. It's not really useful for maintaining RJIT to flag this test failure, so let's just ignore it until we figure out why it fails. https://github.com/ruby/ruby/actions/runs/6752729246/job/18358439166
Diffstat (limited to 'test')
-rw-r--r--test/-ext-/bug_reporter/test_bug_reporter.rb7
-rw-r--r--test/lib/jit_support.rb8
2 files changed, 10 insertions, 5 deletions
diff --git a/test/-ext-/bug_reporter/test_bug_reporter.rb b/test/-ext-/bug_reporter/test_bug_reporter.rb
index 1d3d253c04..fd043690ac 100644
--- a/test/-ext-/bug_reporter/test_bug_reporter.rb
+++ b/test/-ext-/bug_reporter/test_bug_reporter.rb
@@ -4,11 +4,8 @@ require 'tmpdir'
require_relative '../../lib/jit_support'
class TestBugReporter < Test::Unit::TestCase
- def yjit_enabled?
- defined?(RubyVM::YJIT.enabled?) && RubyVM::YJIT.enabled?
- end
-
def test_bug_reporter_add
+ omit "flaky with RJIT" if JITSupport.rjit_enabled?
description = RUBY_DESCRIPTION
description = description.sub(/\+RJIT /, '') unless JITSupport.rjit_force_enabled?
expected_stderr = [
@@ -23,7 +20,7 @@ class TestBugReporter < Test::Unit::TestCase
no_core = "Process.setrlimit(Process::RLIMIT_CORE, 0); " if defined?(Process.setrlimit) && defined?(Process::RLIMIT_CORE)
args = ["-r-test-/bug_reporter", "-C", tmpdir]
- args.push("--yjit") if yjit_enabled? # We want the printed description to match this process's RUBY_DESCRIPTION
+ args.push("--yjit") if JITSupport.yjit_enabled? # We want the printed description to match this process's RUBY_DESCRIPTION
args.unshift({"RUBY_ON_BUG" => nil})
stdin = "#{no_core}register_sample_bug_reporter(12345); Process.kill :SEGV, $$"
assert_in_out_err(args, stdin, [], expected_stderr, encoding: "ASCII-8BIT")
diff --git a/test/lib/jit_support.rb b/test/lib/jit_support.rb
index 3f21367987..cf3baaaeb7 100644
--- a/test/lib/jit_support.rb
+++ b/test/lib/jit_support.rb
@@ -9,6 +9,10 @@ module JITSupport
@yjit_supported = ![nil, 'no'].include?(RbConfig::CONFIG['YJIT_SUPPORT'])
end
+ def yjit_enabled?
+ defined?(RubyVM::YJIT.enabled?) && RubyVM::YJIT.enabled?
+ end
+
def yjit_force_enabled?
"#{RbConfig::CONFIG['CFLAGS']} #{RbConfig::CONFIG['CPPFLAGS']}".match?(/(\A|\s)-D ?YJIT_FORCE_ENABLE\b/)
end
@@ -19,6 +23,10 @@ module JITSupport
@rjit_supported = ![nil, 'no'].include?(RbConfig::CONFIG['RJIT_SUPPORT'])
end
+ def rjit_enabled?
+ defined?(RubyVM::RJIT) && RubyVM::RJIT.enabled?
+ end
+
def rjit_force_enabled?
"#{RbConfig::CONFIG['CFLAGS']} #{RbConfig::CONFIG['CPPFLAGS']}".match?(/(\A|\s)-D ?RJIT_FORCE_ENABLE\b/)
end