mirror of
https://github.com/run-llama/llama_deploy.git
synced 2026-07-01 21:04:00 -04:00
22 lines
418 B
Python
22 lines
418 B
Python
import asyncio
|
|
|
|
import pytest
|
|
|
|
from llama_deploy.message_queues import (
|
|
SimpleMessageQueueConfig,
|
|
SimpleMessageQueueServer,
|
|
)
|
|
|
|
|
|
@pytest.mark.asyncio
|
|
async def test_cancel_launch_server():
|
|
mq = SimpleMessageQueueServer(SimpleMessageQueueConfig(port=8009))
|
|
t = asyncio.create_task(mq.launch_server())
|
|
|
|
# Make sure the queue starts
|
|
await asyncio.sleep(1)
|
|
|
|
# Cancel
|
|
t.cancel()
|
|
await t
|