summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlan Wu <XrXr@users.noreply.github.com>2025-09-15 17:15:23 -0400
committerAlan Wu <XrXr@users.noreply.github.com>2025-09-17 13:35:35 -0400
commit7ed1b24bf3a9400cdf67cc080414d56fa3cfe72d (patch)
treea9e5e2567dfc6a6ddb100a66aa80de1040e2a0ef
parent3fa1eb71151fbd8c970218e6df85c94e8048eef0 (diff)
Unset RUBY_CRASH_REPORT in tests that crash on purpose
-rw-r--r--test/-ext-/bug_reporter/test_bug_reporter.rb2
-rw-r--r--test/ruby/test_rubyoptions.rb1
-rw-r--r--test/ruby/test_vm_dump.rb3
-rw-r--r--tool/test/testunit/test_parallel.rb6
4 files changed, 7 insertions, 5 deletions
diff --git a/test/-ext-/bug_reporter/test_bug_reporter.rb b/test/-ext-/bug_reporter/test_bug_reporter.rb
index 1350675a48..83fdba2282 100644
--- a/test/-ext-/bug_reporter/test_bug_reporter.rb
+++ b/test/-ext-/bug_reporter/test_bug_reporter.rb
@@ -23,7 +23,7 @@ class TestBugReporter < Test::Unit::TestCase
# We want the printed description to match this process's RUBY_DESCRIPTION
args.push("--yjit") if JITSupport.yjit_enabled?
args.push("--zjit") if JITSupport.zjit_enabled?
- args.unshift({"RUBY_ON_BUG" => nil})
+ args.unshift({"RUBY_ON_BUG" => nil, "RUBY_CRASH_REPORT" => nil})
stdin = "#{no_core}register_sample_bug_reporter(12345); Process.kill :SEGV, $$"
assert_in_out_err(args, stdin, [], expected_stderr, encoding: "ASCII-8BIT")
ensure
diff --git a/test/ruby/test_rubyoptions.rb b/test/ruby/test_rubyoptions.rb
index 2c9f8534b1..2b7cf1c899 100644
--- a/test/ruby/test_rubyoptions.rb
+++ b/test/ruby/test_rubyoptions.rb
@@ -855,6 +855,7 @@ class TestRubyOptions < Test::Unit::TestCase
args.unshift("--yjit") if JITSupport.yjit_enabled?
args.unshift("--zjit") if JITSupport.zjit_enabled?
env.update({'RUBY_ON_BUG' => nil})
+ env['RUBY_CRASH_REPORT'] ||= nil # default to not passing down parent setting
# ASAN registers a segv handler which prints out "AddressSanitizer: DEADLYSIGNAL" when
# catching sigsegv; we don't expect that output, so suppress it.
env.update({'ASAN_OPTIONS' => 'handle_segv=0'})
diff --git a/test/ruby/test_vm_dump.rb b/test/ruby/test_vm_dump.rb
index a3e7b69913..d183e03391 100644
--- a/test/ruby/test_vm_dump.rb
+++ b/test/ruby/test_vm_dump.rb
@@ -5,6 +5,7 @@ return unless /darwin/ =~ RUBY_PLATFORM
class TestVMDump < Test::Unit::TestCase
def assert_darwin_vm_dump_works(args, timeout=nil)
+ args.unshift({"RUBY_ON_BUG" => nil, "RUBY_CRASH_REPORT" => nil})
assert_in_out_err(args, "", [], /^\[IMPORTANT\]/, timeout: timeout || 300)
end
@@ -13,7 +14,7 @@ class TestVMDump < Test::Unit::TestCase
end
def test_darwin_segv_in_syscall
- assert_darwin_vm_dump_works('-e1.times{Process.kill :SEGV,$$}')
+ assert_darwin_vm_dump_works(['-e1.times{Process.kill :SEGV,$$}'])
end
def test_darwin_invalid_access
diff --git a/tool/test/testunit/test_parallel.rb b/tool/test/testunit/test_parallel.rb
index d87e0ed327..adf7d62ecd 100644
--- a/tool/test/testunit/test_parallel.rb
+++ b/tool/test/testunit/test_parallel.rb
@@ -151,9 +151,9 @@ module TestParallel
end
class TestParallel < Test::Unit::TestCase
- def spawn_runner(*opt_args, jobs: "t1")
+ def spawn_runner(*opt_args, jobs: "t1", env: {})
@test_out, o = IO.pipe
- @test_pid = spawn(*@__runner_options__[:ruby], TESTS+"/runner.rb",
+ @test_pid = spawn(env, *@__runner_options__[:ruby], TESTS+"/runner.rb",
"--ruby", @__runner_options__[:ruby].join(" "),
"-j", jobs, *opt_args, out: o, err: o)
o.close
@@ -214,7 +214,7 @@ module TestParallel
end
def test_hungup
- spawn_runner "--worker-timeout=1", "--retry", "test4test_hungup.rb"
+ spawn_runner("--worker-timeout=1", "--retry", "test4test_hungup.rb", env: {"RUBY_CRASH_REPORT"=>nil})
buf = ::TestParallel.timeout(TIMEOUT) {@test_out.read}
assert_match(/^Retrying hung up testcases\.+$/, buf)
assert_match(/^2 tests,.* 0 failures,/, buf)