Skip to content

Commit

Permalink
make tests more realistic
Browse files Browse the repository at this point in the history
  • Loading branch information
hbcarlos committed Oct 18, 2023
1 parent 7b858b6 commit 61cc25c
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions tests/test_general.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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)))

Expand All @@ -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"
Expand All @@ -62,7 +63,7 @@ async def fn(

await sleep(0.2)

n = 1000
n = 100
content = "test"
res = len(content) * n

Expand Down

0 comments on commit 61cc25c

Please sign in to comment.