Skip to content

Commit

Permalink
Workaround shutdown issue with aiosqlite for now (jupyterlab#278)
Browse files Browse the repository at this point in the history
* Workaround shutdown issue with `aiosqlite` for now

* Also wait to stop in `test_room_concurrent_initialization`

* Try to delete jupyter_server_fileid early
  • Loading branch information
krassowski authored Apr 2, 2024
1 parent cbff9e0 commit b49bc4f
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions tests/test_documents.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
):
Expand All @@ -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,
):
Expand All @@ -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)

0 comments on commit b49bc4f

Please sign in to comment.