mirror of
https://github.com/BerriAI/litellm.git
synced 2026-08-28 05:25:59 +00:00
test_queue_flush_limit
This commit is contained in:
parent
0d697e6c3e
commit
9ce7871d8a
1 changed files with 4 additions and 1 deletions
|
|
@ -21,8 +21,11 @@ async def test_queue_flush_limit():
|
|||
"""
|
||||
# Arrange
|
||||
queue = BaseUpdateQueue()
|
||||
# Add more items than the max flush count
|
||||
# Override maxsize so the queue can hold all test items without blocking.
|
||||
# The default LITELLM_ASYNCIO_QUEUE_MAXSIZE (1000) equals MAX_IN_MEMORY_QUEUE_FLUSH_COUNT,
|
||||
# so adding more items than that would cause `await queue.put()` to block forever.
|
||||
items_to_add = MAX_IN_MEMORY_QUEUE_FLUSH_COUNT + 100
|
||||
queue.update_queue = asyncio.Queue(maxsize=items_to_add + 1)
|
||||
|
||||
for i in range(items_to_add):
|
||||
await queue.add_update(f"test_update_{i}")
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue