test/test_stackprof.rb in stackprof-0.2.0 vs test/test_stackprof.rb in stackprof-0.2.1
- old
+ new
@@ -56,11 +56,10 @@
end
assert_operator profile[:samples], :>, 1
frame = profile[:frames].values.first
assert_equal "block in StackProfTest#math", frame[:name]
- File.open('/tmp/cputime.dump','w'){|f| f.write Marshal.dump(profile) }
end
def test_walltime
profile = StackProf.run(mode: :wall) do
idle
@@ -97,11 +96,13 @@
assert_equal true, StackProf.running?
end
end
def test_gc
- profile = StackProf.run(mode: :cpu, interval: 100) do
- GC.start
+ profile = StackProf.run(interval: 100) do
+ 5.times do
+ GC.start
+ end
end
assert_empty profile[:frames]
assert_operator profile[:gc_samples], :>, 0
assert_equal 0, profile[:missed_samples]