test/test_stackprof.rb in stackprof-0.2.18 vs test/test_stackprof.rb in stackprof-0.2.19
- old
+ new
@@ -129,10 +129,11 @@
before_monotonic = Process.clock_gettime(Process::CLOCK_MONOTONIC, :microsecond)
profile = StackProf.run(mode: :custom, raw: true) do
10.times do
StackProf.sample
+ sleep 0.0001
end
end
after_monotonic = Process.clock_gettime(Process::CLOCK_MONOTONIC, :microsecond)
@@ -151,9 +152,13 @@
end
assert_equal 10, profile[:raw_timestamp_deltas].size
total_duration = after_monotonic - before_monotonic
assert_operator profile[:raw_timestamp_deltas].inject(&:+), :<, total_duration
+
+ profile[:raw_timestamp_deltas].each do |delta|
+ assert_operator delta, :>, 0
+ end
end
def test_metadata
metadata = {
path: '/foo/bar',