Skip to content

Commit f4c8e28

Browse files
krassowskiandrii-i
authored andcommitted
Workaround shutdown issue with aiosqlite for now (jupyterlab#278)
* Workaround shutdown issue with `aiosqlite` for now * Also wait to stop in `test_room_concurrent_initialization` * Try to delete jupyter_server_fileid early
1 parent b477564 commit f4c8e28

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

tests/test_documents.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,16 @@ async def test_dirty(
4040
assert not jupyter_ydoc.dirty
4141

4242

43+
async def cleanup(jp_serverapp):
44+
# workaround for a shutdown issue of aiosqlite, see
45+
# https://github.com/jupyterlab/jupyter-collaboration/issues/252
46+
await jp_serverapp.web_app.settings["jupyter_collaboration"].stop_extension()
47+
# workaround `jupyter_server_fileid` manager accessing database on GC
48+
del jp_serverapp.web_app.settings["file_id_manager"]
49+
50+
4351
async def test_room_concurrent_initialization(
52+
jp_serverapp,
4453
rtc_create_file,
4554
rtc_connect_doc_client,
4655
):
@@ -60,8 +69,11 @@ async def connect(file_format, file_type, file_path):
6069
t1 = time()
6170
assert t1 - t0 < 0.5
6271

72+
await cleanup(jp_serverapp)
73+
6374

6475
async def test_room_sequential_opening(
76+
jp_serverapp,
6577
rtc_create_file,
6678
rtc_connect_doc_client,
6779
):
@@ -81,3 +93,5 @@ async def connect(file_format, file_type, file_path):
8193
assert dt < 1
8294
dt = await connect(file_format, file_type, file_path)
8395
assert dt < 1
96+
97+
await cleanup(jp_serverapp)

0 commit comments

Comments
 (0)