Skip to content

Commit e9c9d32

Browse files
committed
[GR-50893] Add spec for SIGQUIT and SIGALRM showing stacktraces
1 parent 66b641f commit e9c9d32

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

spec/truffle/tools_spec.rb

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,24 @@
2929
end
3030
end
3131

32+
describe "SIGQUIT" do
33+
it "shows Java stacktraces" do
34+
code = 'Process.kill :SIGQUIT, Process.pid; sleep 1'
35+
out = ruby_exe(code, args: "2>&1")
36+
out.should.include?("Full thread dump")
37+
out.should.include?("RubyLauncher.runRubyMain")
38+
end
39+
end
40+
41+
describe "SIGALRM" do
42+
it "shows Ruby backtraces" do
43+
code = 'Process.kill :SIGALRM, Process.pid; sleep 1'
44+
out = ruby_exe(code, args: "2>&1")
45+
out.should.include?("All Thread and Fiber backtraces:")
46+
out.should.include?(":in `show_backtraces'")
47+
end
48+
end
49+
3250
describe "--coverage" do
3351
before :each do
3452
@file = tmp("main.rb")

0 commit comments

Comments
 (0)