From 489004ac4023cf931f30c670561b120861d39f53 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Krassowski?= <5832902+krassowski@users.noreply.github.com> Date: Tue, 2 Apr 2024 14:46:45 +0100 Subject: [PATCH] Workaround shutdown issue with `aiosqlite` for now (#278) * Workaround shutdown issue with `aiosqlite` for now * Also wait to stop in `test_room_concurrent_initialization` * Try to delete jupyter_server_fileid early --- tests/test_documents.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/tests/test_documents.py b/tests/test_documents.py index ae43fd8d..fcb67b2a 100644 --- a/tests/test_documents.py +++ b/tests/test_documents.py @@ -40,7 +40,16 @@ async def test_dirty( assert not jupyter_ydoc.dirty +async def cleanup(jp_serverapp): + # workaround for a shutdown issue of aiosqlite, see + # https://github.com/jupyterlab/jupyter-collaboration/issues/252 + await jp_serverapp.web_app.settings["jupyter_collaboration"].stop_extension() + # workaround `jupyter_server_fileid` manager accessing database on GC + del jp_serverapp.web_app.settings["file_id_manager"] + + async def test_room_concurrent_initialization( + jp_serverapp, rtc_create_file, rtc_connect_doc_client, ): @@ -60,8 +69,11 @@ async def connect(file_format, file_type, file_path): t1 = time() assert t1 - t0 < 0.5 + await cleanup(jp_serverapp) + async def test_room_sequential_opening( + jp_serverapp, rtc_create_file, rtc_connect_doc_client, ): @@ -81,3 +93,5 @@ async def connect(file_format, file_type, file_path): assert dt < 1 dt = await connect(file_format, file_type, file_path) assert dt < 1 + + await cleanup(jp_serverapp)