From 61cc25cb28949104a6159c515a1e06b3e0699c42 Mon Sep 17 00:00:00 2001 From: Carlos Herrero <26092748+hbcarlos@users.noreply.github.com> Date: Wed, 18 Oct 2023 16:07:22 +0200 Subject: [PATCH] make tests more realistic --- tests/test_general.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/tests/test_general.py b/tests/test_general.py index 88f40da7..6264bc50 100644 --- a/tests/test_general.py +++ b/tests/test_general.py @@ -10,7 +10,7 @@ from ypy_websocket import WebsocketProvider -async def test_thousand_clients(rtc_create_file, rtc_connect_doc_client): +async def test_hundred_clients(rtc_create_file, rtc_connect_doc_client): file_path = "test.txt" file_format = "text" file_type = "file" @@ -31,7 +31,8 @@ async def fn( await sleep(0.2) clients = [] - for _ in range(1000): + n = 100 + for _ in range(n): doc = YUnicode() clients.append(create_task(fn(file_format, file_type, file_path, doc, 1))) @@ -41,10 +42,10 @@ async def fn( await wait(clients) - assert sum(list(test_array)) == 1000 + assert sum(list(test_array)) == n -async def test_thousand_clients_insert_text(rtc_create_file, rtc_connect_doc_client): +async def test_hundred_clients_insert_text(rtc_create_file, rtc_connect_doc_client): file_path = "test.txt" file_format = "text" file_type = "file" @@ -62,7 +63,7 @@ async def fn( await sleep(0.2) - n = 1000 + n = 100 content = "test" res = len(content) * n