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
This commit is contained in:
Takashi Kokubun 2023-11-03 22:18:15 -07:00
parent 6b2a3c84a5
commit 9f95b6eb5d
2 changed files with 10 additions and 5 deletions

View File

@ -4,11 +4,8 @@ require 'tmpdir'
require_relative '../../lib/jit_support' require_relative '../../lib/jit_support'
class TestBugReporter < Test::Unit::TestCase class TestBugReporter < Test::Unit::TestCase
def yjit_enabled?
defined?(RubyVM::YJIT.enabled?) && RubyVM::YJIT.enabled?
end
def test_bug_reporter_add def test_bug_reporter_add
omit "flaky with RJIT" if JITSupport.rjit_enabled?
description = RUBY_DESCRIPTION description = RUBY_DESCRIPTION
description = description.sub(/\+RJIT /, '') unless JITSupport.rjit_force_enabled? description = description.sub(/\+RJIT /, '') unless JITSupport.rjit_force_enabled?
expected_stderr = [ 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) no_core = "Process.setrlimit(Process::RLIMIT_CORE, 0); " if defined?(Process.setrlimit) && defined?(Process::RLIMIT_CORE)
args = ["-r-test-/bug_reporter", "-C", tmpdir] 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}) args.unshift({"RUBY_ON_BUG" => nil})
stdin = "#{no_core}register_sample_bug_reporter(12345); Process.kill :SEGV, $$" stdin = "#{no_core}register_sample_bug_reporter(12345); Process.kill :SEGV, $$"
assert_in_out_err(args, stdin, [], expected_stderr, encoding: "ASCII-8BIT") assert_in_out_err(args, stdin, [], expected_stderr, encoding: "ASCII-8BIT")

View File

@ -9,6 +9,10 @@ module JITSupport
@yjit_supported = ![nil, 'no'].include?(RbConfig::CONFIG['YJIT_SUPPORT']) @yjit_supported = ![nil, 'no'].include?(RbConfig::CONFIG['YJIT_SUPPORT'])
end end
def yjit_enabled?
defined?(RubyVM::YJIT.enabled?) && RubyVM::YJIT.enabled?
end
def yjit_force_enabled? def yjit_force_enabled?
"#{RbConfig::CONFIG['CFLAGS']} #{RbConfig::CONFIG['CPPFLAGS']}".match?(/(\A|\s)-D ?YJIT_FORCE_ENABLE\b/) "#{RbConfig::CONFIG['CFLAGS']} #{RbConfig::CONFIG['CPPFLAGS']}".match?(/(\A|\s)-D ?YJIT_FORCE_ENABLE\b/)
end end
@ -19,6 +23,10 @@ module JITSupport
@rjit_supported = ![nil, 'no'].include?(RbConfig::CONFIG['RJIT_SUPPORT']) @rjit_supported = ![nil, 'no'].include?(RbConfig::CONFIG['RJIT_SUPPORT'])
end end
def rjit_enabled?
defined?(RubyVM::RJIT) && RubyVM::RJIT.enabled?
end
def rjit_force_enabled? def rjit_force_enabled?
"#{RbConfig::CONFIG['CFLAGS']} #{RbConfig::CONFIG['CPPFLAGS']}".match?(/(\A|\s)-D ?RJIT_FORCE_ENABLE\b/) "#{RbConfig::CONFIG['CFLAGS']} #{RbConfig::CONFIG['CPPFLAGS']}".match?(/(\A|\s)-D ?RJIT_FORCE_ENABLE\b/)
end end