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 255
255
specify 'a #post task is never executed when the queue is at capacity' do
256
256
executed = Concurrent ::AtomicFixnum . new ( 0 )
257
257
1000 . times do
258
- subject . post { executed . increment }
258
+ subject . post { sleep ; executed . increment }
259
259
end
260
260
sleep ( 0.1 )
261
- expect ( executed . value ) . to be < 1000
261
+ expect ( executed . value ) . to be 0
262
262
end
263
263
264
264
specify 'a #<< task is never executed when the queue is at capacity' do
265
265
executed = Concurrent ::AtomicFixnum . new ( 0 )
266
266
1000 . times do
267
- subject << proc { executed . increment }
267
+ subject << proc { sleep ; executed . increment }
268
268
end
269
269
sleep ( 0.1 )
270
- expect ( executed . value ) . to be < 1000
270
+ expect ( executed . value ) . to be 0
271
271
end
272
272
273
273
specify 'a #post task is never executed when the executor is shutting down' do
274
274
executed = Concurrent ::AtomicFixnum . new ( 0 )
275
275
subject . shutdown
276
- subject . post { executed . increment }
276
+ subject . post { sleep ; executed . increment }
277
277
sleep ( 0.1 )
278
278
expect ( executed . value ) . to be 0
279
279
end
You can’t perform that action at this time.
0 commit comments