Skip to content

Commit 61cc25c

Browse files
committed
make tests more realistic
1 parent 7b858b6 commit 61cc25c

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

tests/test_general.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
from ypy_websocket import WebsocketProvider
1111

1212

13-
async def test_thousand_clients(rtc_create_file, rtc_connect_doc_client):
13+
async def test_hundred_clients(rtc_create_file, rtc_connect_doc_client):
1414
file_path = "test.txt"
1515
file_format = "text"
1616
file_type = "file"
@@ -31,7 +31,8 @@ async def fn(
3131
await sleep(0.2)
3232

3333
clients = []
34-
for _ in range(1000):
34+
n = 100
35+
for _ in range(n):
3536
doc = YUnicode()
3637
clients.append(create_task(fn(file_format, file_type, file_path, doc, 1)))
3738

@@ -41,10 +42,10 @@ async def fn(
4142

4243
await wait(clients)
4344

44-
assert sum(list(test_array)) == 1000
45+
assert sum(list(test_array)) == n
4546

4647

47-
async def test_thousand_clients_insert_text(rtc_create_file, rtc_connect_doc_client):
48+
async def test_hundred_clients_insert_text(rtc_create_file, rtc_connect_doc_client):
4849
file_path = "test.txt"
4950
file_format = "text"
5051
file_type = "file"
@@ -62,7 +63,7 @@ async def fn(
6263

6364
await sleep(0.2)
6465

65-
n = 1000
66+
n = 100
6667
content = "test"
6768
res = len(content) * n
6869

0 commit comments

Comments
 (0)