Skip to content

Commit

Permalink
Fix incorrect assertion in TestThreadInstrumentation
Browse files Browse the repository at this point in the history
The test meant to assert the thread is suspended at least once,
but was actually asserting to it to be suspected at least twice.
  • Loading branch information
byroot committed May 20, 2024
1 parent fa26ef5 commit 0b38403
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions test/-ext-/thread/test_instrumentation_api.rb
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ def test_thread_pass_multi_thread
thread&.join
end

def test_muti_thread_timeline
def test_multi_thread_timeline
threads = nil
full_timeline = record do
threads = threaded_cpu_bound_work(1.0)
Expand All @@ -68,7 +68,7 @@ def test_muti_thread_timeline
threads.each do |thread|
timeline = timeline_for(thread, full_timeline)
assert_consistent_timeline(timeline)
assert timeline.count(:suspended) > 1, "Expected threads to yield suspended at least once: #{timeline.inspect}"
assert_operator timeline.count(:suspended), :>=, 1, "Expected threads to yield suspended at least once: #{timeline.inspect}"
end

timeline = timeline_for(Thread.current, full_timeline)
Expand Down

0 comments on commit 0b38403

Please sign in to comment.