Skip to content

Commit 7ed1b24

Browse files
committed
Unset RUBY_CRASH_REPORT in tests that crash on purpose
1 parent 3fa1eb7 commit 7ed1b24

File tree

4 files changed

+7
-5
lines changed

4 files changed

+7
-5
lines changed

test/-ext-/bug_reporter/test_bug_reporter.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ def test_bug_reporter_add
2323
# We want the printed description to match this process's RUBY_DESCRIPTION
2424
args.push("--yjit") if JITSupport.yjit_enabled?
2525
args.push("--zjit") if JITSupport.zjit_enabled?
26-
args.unshift({"RUBY_ON_BUG" => nil})
26+
args.unshift({"RUBY_ON_BUG" => nil, "RUBY_CRASH_REPORT" => nil})
2727
stdin = "#{no_core}register_sample_bug_reporter(12345); Process.kill :SEGV, $$"
2828
assert_in_out_err(args, stdin, [], expected_stderr, encoding: "ASCII-8BIT")
2929
ensure

test/ruby/test_rubyoptions.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -855,6 +855,7 @@ def assert_segv(args, message=nil, list: SEGVTest::ExpectedStderrList, **opt, &b
855855
args.unshift("--yjit") if JITSupport.yjit_enabled?
856856
args.unshift("--zjit") if JITSupport.zjit_enabled?
857857
env.update({'RUBY_ON_BUG' => nil})
858+
env['RUBY_CRASH_REPORT'] ||= nil # default to not passing down parent setting
858859
# ASAN registers a segv handler which prints out "AddressSanitizer: DEADLYSIGNAL" when
859860
# catching sigsegv; we don't expect that output, so suppress it.
860861
env.update({'ASAN_OPTIONS' => 'handle_segv=0'})

test/ruby/test_vm_dump.rb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55

66
class TestVMDump < Test::Unit::TestCase
77
def assert_darwin_vm_dump_works(args, timeout=nil)
8+
args.unshift({"RUBY_ON_BUG" => nil, "RUBY_CRASH_REPORT" => nil})
89
assert_in_out_err(args, "", [], /^\[IMPORTANT\]/, timeout: timeout || 300)
910
end
1011

@@ -13,7 +14,7 @@ def test_darwin_invalid_call
1314
end
1415

1516
def test_darwin_segv_in_syscall
16-
assert_darwin_vm_dump_works('-e1.times{Process.kill :SEGV,$$}')
17+
assert_darwin_vm_dump_works(['-e1.times{Process.kill :SEGV,$$}'])
1718
end
1819

1920
def test_darwin_invalid_access

tool/test/testunit/test_parallel.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -151,9 +151,9 @@ def test_quit
151151
end
152152

153153
class TestParallel < Test::Unit::TestCase
154-
def spawn_runner(*opt_args, jobs: "t1")
154+
def spawn_runner(*opt_args, jobs: "t1", env: {})
155155
@test_out, o = IO.pipe
156-
@test_pid = spawn(*@__runner_options__[:ruby], TESTS+"/runner.rb",
156+
@test_pid = spawn(env, *@__runner_options__[:ruby], TESTS+"/runner.rb",
157157
"--ruby", @__runner_options__[:ruby].join(" "),
158158
"-j", jobs, *opt_args, out: o, err: o)
159159
o.close
@@ -214,7 +214,7 @@ def test_separate
214214
end
215215

216216
def test_hungup
217-
spawn_runner "--worker-timeout=1", "--retry", "test4test_hungup.rb"
217+
spawn_runner("--worker-timeout=1", "--retry", "test4test_hungup.rb", env: {"RUBY_CRASH_REPORT"=>nil})
218218
buf = ::TestParallel.timeout(TIMEOUT) {@test_out.read}
219219
assert_match(/^Retrying hung up testcases\.+$/, buf)
220220
assert_match(/^2 tests,.* 0 failures,/, buf)

0 commit comments

Comments
 (0)