Skip to content

Commit 0cead11

Browse files
committed
Stabilize RubyThreadPool specs
1 parent c94f03b commit 0cead11

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

spec/concurrent/executor/ruby_cached_thread_pool_spec.rb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,12 +92,13 @@ module Concurrent
9292
specify do
9393
pool = RubyThreadPoolExecutor.new(config)
9494

95-
100.times do
95+
10.times do
9696
count = Concurrent::CountDownLatch.new(100)
9797
100.times do
9898
pool.post { count.count_down }
9999
end
100100
count.wait
101+
sleep 0.01 # let the tasks end after count_down
101102
expect(pool.length).to be <= [200, config[:max_threads]].min
102103
if pool.length > [110, config[:max_threads]].min
103104
puts "ERRORSIZE #{pool.length} max #{config[:max_threads]}"

0 commit comments

Comments
 (0)