Skip to content

Commit 6d0db54

Browse files
committed
Fixed intermittently failing RubyThreadPoolExecutor spec.
1 parent 168376d commit 6d0db54

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

spec/concurrent/executor/ruby_thread_pool_executor_spec.rb

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -82,26 +82,26 @@ module Concurrent
8282

8383
specify 'a #post task is never executed when the queue is at capacity' do
8484
executed = Concurrent::AtomicFixnum.new(0)
85-
100.times do
85+
10.times do
8686
begin
87-
subject.post{ executed.increment }
87+
subject.post{ executed.increment; sleep(0.1) }
8888
rescue
8989
end
9090
end
91-
sleep(0.1)
92-
executed.value.should < 100
91+
sleep(0.2)
92+
executed.value.should < 10
9393
end
9494

9595
specify 'a #<< task is never executed when the queue is at capacity' do
9696
executed = Concurrent::AtomicFixnum.new(0)
97-
100.times do
97+
10.times do
9898
begin
99-
subject << proc { executed.increment }
99+
subject << proc { executed.increment; sleep(0.1) }
100100
rescue
101101
end
102102
end
103-
sleep(0.1)
104-
executed.value.should < 100
103+
sleep(0.2)
104+
executed.value.should < 10
105105
end
106106
end
107107

0 commit comments

Comments
 (0)