Bootstrap tamq local tmux agent message queue
Some checks failed
tamq-ci / test (push) Failing after 36s
Some checks failed
tamq-ci / test (push) Failing after 36s
Assistant: codex Assistant-Model: gpt-5.6-sol Assistant-Session: 01a02f34-ead4-7a60-85cd-d7f08e22fa0e
This commit is contained in:
parent
521bbe5afc
commit
4d915a2617
58 changed files with 1882 additions and 1 deletions
25
tests/test_shutdown.py
Normal file
25
tests/test_shutdown.py
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
import asyncio
|
||||
|
||||
from tamq.service import Service
|
||||
from tamq.store import Store
|
||||
|
||||
|
||||
def test_service_shutdown_removes_socket(tmp_path, monkeypatch):
|
||||
monkeypatch.setenv("TAMQ_PIDFILE", str(tmp_path / "tamq.pid"))
|
||||
async def run():
|
||||
socket = tmp_path / "tamq.sock"
|
||||
service = Service(socket, Store(tmp_path / "queue.sqlite3"))
|
||||
task = asyncio.create_task(service.run())
|
||||
for _ in range(20):
|
||||
if socket.exists():
|
||||
break
|
||||
await asyncio.sleep(0.01)
|
||||
assert socket.exists()
|
||||
service.server.close()
|
||||
await service.server.wait_closed()
|
||||
task.cancel()
|
||||
try:
|
||||
await task
|
||||
except asyncio.CancelledError:
|
||||
pass
|
||||
asyncio.run(run())
|
||||
Loading…
Add table
Add a link
Reference in a new issue