Skip to content

Commit

Permalink
Add sleep statement to nudge thread scheduler in request pool spec (m…
Browse files Browse the repository at this point in the history
  • Loading branch information
mjankowski authored Jan 4, 2024
1 parent ae39bed commit 964a0ec
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions spec/lib/request_pool_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,13 @@

subject

threads = Array.new(20) do |_i|
threads = Array.new(3) do
Thread.new do
20.times do
2.times do
subject.with('http://example.com') do |http_client|
http_client.get('/').flush
# Nudge scheduler to yield and exercise the full pool
sleep(0)
end
end
end
Expand Down

0 comments on commit 964a0ec

Please sign in to comment.