File tree Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Original file line number Diff line number Diff line change 255255 specify 'a #post task is never executed when the queue is at capacity' do
256256 executed = Concurrent ::AtomicFixnum . new ( 0 )
257257 1000 . times do
258- subject . post { executed . increment }
258+ subject . post { sleep ; executed . increment }
259259 end
260260 sleep ( 0.1 )
261- expect ( executed . value ) . to be < 1000
261+ expect ( executed . value ) . to be 0
262262 end
263263
264264 specify 'a #<< task is never executed when the queue is at capacity' do
265265 executed = Concurrent ::AtomicFixnum . new ( 0 )
266266 1000 . times do
267- subject << proc { executed . increment }
267+ subject << proc { sleep ; executed . increment }
268268 end
269269 sleep ( 0.1 )
270- expect ( executed . value ) . to be < 1000
270+ expect ( executed . value ) . to be 0
271271 end
272272
273273 specify 'a #post task is never executed when the executor is shutting down' do
274274 executed = Concurrent ::AtomicFixnum . new ( 0 )
275275 subject . shutdown
276- subject . post { executed . increment }
276+ subject . post { sleep ; executed . increment }
277277 sleep ( 0.1 )
278278 expect ( executed . value ) . to be 0
279279 end
You can’t perform that action at this time.
0 commit comments