From f89efd5fcebd55aa19795a525e7fb8968bd43319 Mon Sep 17 00:00:00 2001 From: link2xt Date: Fri, 1 Dec 2023 03:41:05 +0000 Subject: [PATCH] test: test inserting lots of webxdc updates Currently this leads to DEBUG root:rpc.py:136 account_id=1 got an event {'kind': 'Warning', 'msg': 'src/scheduler.rs:711: send_smtp_messages failed: failed to send message: failed to update retries count: database is locked: Error code 5: The database file is locked'} and FAILED tests/test_webxdc.py::test_webxdc_insert_lots_of_updates - deltachat_rpc_client.rpc.JsonRpcError: {'code': -1, 'message': 'database is locked\n\nCaused by:\n Error code 5: The database file is locked'} --- deltachat-rpc-client/tests/test_webxdc.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/deltachat-rpc-client/tests/test_webxdc.py b/deltachat-rpc-client/tests/test_webxdc.py index 8f3d8edcb..3c5715731 100644 --- a/deltachat-rpc-client/tests/test_webxdc.py +++ b/deltachat-rpc-client/tests/test_webxdc.py @@ -43,3 +43,15 @@ def test_webxdc(acfactory) -> None: assert status_updates == [ {"payload": "Second update", "serial": 2, "max_serial": 2}, ] + + +def test_webxdc_insert_lots_of_updates(acfactory) -> None: + alice, bob = acfactory.get_online_accounts(2) + + bob_addr = bob.get_config("addr") + alice_contact_bob = alice.create_contact(bob_addr, "Bob") + alice_chat_bob = alice_contact_bob.create_chat() + message = alice_chat_bob.send_message(text="Let's play chess!", file="../test-data/webxdc/chess.xdc") + + for i in range(2000): + message.send_webxdc_status_update({"payload": str(i)}, "description")