From 157fc699547e409a2849a1842456ce36d5d545b1 Mon Sep 17 00:00:00 2001 From: Claire Date: Mon, 8 Jan 2024 13:29:05 +0100 Subject: [PATCH] Make request_pool_spec tests more robust (#28610) --- spec/lib/request_pool_spec.rb | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/spec/lib/request_pool_spec.rb b/spec/lib/request_pool_spec.rb index bdb0859d76..a31d078327 100644 --- a/spec/lib/request_pool_spec.rb +++ b/spec/lib/request_pool_spec.rb @@ -33,14 +33,12 @@ describe RequestPool do subject - threads = Array.new(3) do + threads = Array.new(5) do Thread.new 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 + subject.with('http://example.com') do |http_client| + http_client.get('/').flush + # Nudge scheduler to yield and exercise the full pool + sleep(0.01) end end end