From 10b6dd1f1191d758abf67fff731eae4795ecfd65 Mon Sep 17 00:00:00 2001 From: Hocuri Date: Sat, 15 Nov 2025 18:49:16 +0100 Subject: [PATCH] test(rpc-client): test_qr_securejoin_broadcast: Wait for incoming message before getting chatlist (#7442) Fix flaky test by calling `get_broadcast()` after the message events were received. Alternative to https://github.com/chatmail/core/pull/7437 --- deltachat-rpc-client/tests/test_securejoin.py | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/deltachat-rpc-client/tests/test_securejoin.py b/deltachat-rpc-client/tests/test_securejoin.py index 4e9dc8836..c09cf1a23 100644 --- a/deltachat-rpc-client/tests/test_securejoin.py +++ b/deltachat-rpc-client/tests/test_securejoin.py @@ -140,15 +140,15 @@ def test_qr_securejoin_broadcast(acfactory, all_devices_online): return chat def wait_for_broadcast_messages(ac): + snapshot1 = ac.wait_for_incoming_msg().get_snapshot() + assert snapshot1.text == "You joined the channel." + + snapshot2 = ac.wait_for_incoming_msg().get_snapshot() + assert snapshot2.text == "Hello everyone!" + chat = get_broadcast(ac) - - snapshot = ac.wait_for_incoming_msg().get_snapshot() - assert snapshot.text == "You joined the channel." - assert snapshot.chat_id == chat.id - - snapshot = ac.wait_for_incoming_msg().get_snapshot() - assert snapshot.text == "Hello everyone!" - assert snapshot.chat_id == chat.id + assert snapshot1.chat_id == chat.id + assert snapshot2.chat_id == chat.id def check_account(ac, contact, inviter_side, please_wait_info_msg=False): # Check that the chat partner is verified.