File tree Expand file tree Collapse file tree 1 file changed +6
-5
lines changed Expand file tree Collapse file tree 1 file changed +6
-5
lines changed Original file line number Diff line number Diff line change 182
182
183
183
context 'overflow policy' do
184
184
185
- before do
185
+ before ( :each ) do
186
186
@queue = Queue . new
187
187
end
188
188
189
+ after ( :each ) do
190
+ subject . kill
191
+ end
192
+
189
193
# On abort, it should raise an error
190
194
it "raises an error when overflow on abort" do
191
195
latch = Concurrent ::CountDownLatch . new ( 5 )
200
204
latch . count_down
201
205
end
202
206
end
203
- subject . shutdown
204
207
latch . wait ( 1 )
205
208
} . to raise_error
206
209
end
218
221
latch . count_down
219
222
end
220
223
end
221
- subject . shutdown
222
224
latch . wait ( 1 )
223
225
224
226
@queue . length . should be < 5
227
229
# To check for caller_runs, we'll check how many unique threads
228
230
# actually ran the block
229
231
230
- it 'uses the calling thread for overflow under caller_runs' , :brittle do
232
+ it 'uses the calling thread for overflow under caller_runs' do
231
233
latch = Concurrent ::CountDownLatch . new ( 5 )
232
234
mutex = Mutex . new
233
235
240
242
latch . count_down
241
243
end
242
244
end
243
- subject . shutdown
244
245
latch . wait ( 1 )
245
246
246
247
# Turn the queue into an array
You can’t perform that action at this time.
0 commit comments