File tree Expand file tree Collapse file tree 1 file changed +4
-1
lines changed Expand file tree Collapse file tree 1 file changed +4
-1
lines changed Original file line number Diff line number Diff line change @@ -242,17 +242,20 @@ async def test_CapacityLimiter_zero_limit_tokens() -> None:
242
242
await c .acquire_on_behalf_of (0 ) # total_tokens is 1
243
243
244
244
nursery .start_soon (c .acquire_on_behalf_of , 1 )
245
+ await wait_all_tasks_blocked ()
245
246
c .total_tokens = 0
246
247
247
248
assert c .statistics ().borrowers == [0 ]
248
249
249
250
c .release_on_behalf_of (0 )
251
+ await wait_all_tasks_blocked ()
250
252
assert c .statistics ().borrowers == []
251
- assert c .statistics ().tasks_waiting == 0
253
+ assert c .statistics ().tasks_waiting == 1
252
254
253
255
c .total_tokens = 1
254
256
await wait_all_tasks_blocked ()
255
257
assert c .statistics ().borrowers == [1 ]
258
+ assert c .statistics ().tasks_waiting == 0
256
259
257
260
c .release_on_behalf_of (1 )
258
261
You can’t perform that action at this time.
0 commit comments