mirror of
https://git.bsd.gay/fef/nyastodon.git
synced 2024-12-25 19:03:43 +01:00
Add sleep statement to nudge thread scheduler in request pool spec (#28596)
This commit is contained in:
parent
ae39bed95b
commit
964a0ecf37
1 changed files with 4 additions and 2 deletions
|
@ -33,11 +33,13 @@ describe RequestPool do
|
||||||
|
|
||||||
subject
|
subject
|
||||||
|
|
||||||
threads = Array.new(20) do |_i|
|
threads = Array.new(3) do
|
||||||
Thread.new do
|
Thread.new do
|
||||||
20.times do
|
2.times do
|
||||||
subject.with('http://example.com') do |http_client|
|
subject.with('http://example.com') do |http_client|
|
||||||
http_client.get('/').flush
|
http_client.get('/').flush
|
||||||
|
# Nudge scheduler to yield and exercise the full pool
|
||||||
|
sleep(0)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue