Skip to content

Commit

Permalink
Fix slow room opening
Browse files Browse the repository at this point in the history
  • Loading branch information
davidbrochart committed Mar 27, 2024
1 parent 35a515c commit a5d6c7b
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions tests/test_documents.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,3 +59,25 @@ async def connect(file_format, file_type, file_path):
tg.start_soon(connect, file_format, file_type, file_path)
t1 = time()
assert t1 - t0 < 0.5


async def test_room_sequential_opening(
rtc_create_file,
rtc_connect_doc_client,
):
file_format = "text"
file_type = "file"
file_path = "dummy.txt"
await rtc_create_file(file_path)

async def connect(file_format, file_type, file_path):
t0 = time()
async with await rtc_connect_doc_client(file_format, file_type, file_path) as ws:
pass
t1 = time()
return t1 - t0

dt = await connect(file_format, file_type, file_path)
assert dt < 1
dt = await connect(file_format, file_type, file_path)
assert dt < 1

0 comments on commit a5d6c7b

Please sign in to comment.