Skip to content

Commit 308fe1e

Browse files
committed
Do not create core file if it is intentional abort
Two tests abort intentionally and they create core files if possible. In these case, we don't need to see core files so disable by `"Process.setrlimit(Process::RLIMIT_CORE, 0)` for those cases.
1 parent d650b17 commit 308fe1e

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

test/-ext-/bug_reporter/test_bug_reporter.rb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,10 @@ def test_bug_reporter_add
1919
]
2020
tmpdir = Dir.mktmpdir
2121

22+
no_core = "Process.setrlimit(Process::RLIMIT_CORE, 0); " if defined?(Process.setrlimit) && defined?(Process::RLIMIT_CORE)
2223
args = ["--disable-gems", "-r-test-/bug_reporter",
2324
"-C", tmpdir]
24-
stdin = "register_sample_bug_reporter(12345); Process.kill :SEGV, $$"
25+
stdin = "#{no_core}register_sample_bug_reporter(12345); Process.kill :SEGV, $$"
2526
assert_in_out_err(args, stdin, [], expected_stderr, encoding: "ASCII-8BIT")
2627
ensure
2728
FileUtils.rm_rf(tmpdir) if tmpdir

test/ruby/test_signal.rb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -291,7 +291,8 @@ def test_ignored_interrupt
291291

292292
if trap = Signal.list['TRAP']
293293
bug9820 = '[ruby-dev:48592] [Bug #9820]'
294-
status = assert_in_out_err(['-e', 'Process.kill(:TRAP, $$)'])
294+
no_core = "Process.setrlimit(Process::RLIMIT_CORE, 0); " if defined?(Process.setrlimit) && defined?(Process::RLIMIT_CORE)
295+
status = assert_in_out_err(['-e', "#{no_core}Process.kill(:TRAP, $$)"])
295296
assert_predicate(status, :signaled?, bug9820)
296297
assert_equal(trap, status.termsig, bug9820)
297298
end

0 commit comments

Comments
 (0)