File tree Expand file tree Collapse file tree 2 files changed +23
-0
lines changed Expand file tree Collapse file tree 2 files changed +23
-0
lines changed Original file line number Diff line number Diff line change 1
1
slow:Tools --coverage is available and works
2
2
slow:Tools --coverage works for internal sources
3
3
slow:Tools --engine.TraceCompilation works and outputs to STDERR
4
+ slow:Tools --cpusampler works if Thread#kill is used
Original file line number Diff line number Diff line change 53
53
$?. should . success?
54
54
end
55
55
end
56
+
57
+ describe "--cpusampler" do
58
+ it "works if Thread#kill is used" do
59
+ code = <<~RUBY
60
+ def foo
61
+ n = 0
62
+ loop { itself { n += 1 } }
63
+ n
64
+ end
65
+ t = Thread.new { foo }
66
+ sleep 1
67
+ p :kill
68
+ t.kill
69
+ t.join
70
+ RUBY
71
+ out = ruby_exe ( code , options : "--cpusampler --cpusampler.Mode=roots" )
72
+ out . should . include? ( ":kill" )
73
+ out . should . include? ( "block in Object#foo" )
74
+ out . should_not . include? ( 'KillException' )
75
+ $?. should . success?
76
+ end
77
+ end
56
78
end
You can’t perform that action at this time.
0 commit comments