fix(api): stop serve cleanly with jobs, streams and remote sessions open

This commit is contained in:
imSp4rky
2026-11-28 21:11:50 -07:00
parent f5c8858e6e
commit 7713f8df3f
13 changed files with 222 additions and 45 deletions
+13
View File
@@ -134,6 +134,19 @@ async def test_cancel_all_bridges(store: SessionStore) -> None:
entry.input_bridge.ensure_active()
async def test_cancel_all_bridges_removes_the_session_cache_dirs(
store: SessionStore, monkeypatch: pytest.MonkeyPatch
) -> None:
removed: list = []
monkeypatch.setattr(SessionStore, "cleanup_cache_dir", staticmethod(removed.append))
entry = await store.create("EXAMPLE", _FakeService(), cache_tag="_sessions/k/s/EXAMPLE")
await store.create("OTHER", _FakeService())
await store.cancel_all_bridges()
assert removed == [entry.cache_tag, None]
assert store.session_count == 0
async def test_get_session_store_returns_singleton() -> None:
a = get_session_store()
b = get_session_store()