-
Notifications
You must be signed in to change notification settings - Fork 201
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: make SimpleMessageQueue server cancellable
- Loading branch information
Showing
3 changed files
with
28 additions
and
11 deletions.
There are no files selected for viewing
Empty file.
19 changes: 19 additions & 0 deletions
19
e2e_tests/message_queues/message_queue_simple/test_message_queue.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import asyncio | ||
|
||
import pytest | ||
|
||
from llama_deploy import SimpleMessageQueue | ||
|
||
|
||
@pytest.mark.e2e | ||
@pytest.mark.asyncio | ||
async def test_cancel_launch_server(): | ||
mq = SimpleMessageQueue() | ||
t = asyncio.create_task(mq.launch_server()) | ||
|
||
# Make sure the queue starts | ||
await asyncio.sleep(1) | ||
|
||
# Cancel | ||
t.cancel() | ||
await t |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters