Skip to content

Commit 10b6dd1

Browse files
authored
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 #7437
1 parent cae642b commit 10b6dd1

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

deltachat-rpc-client/tests/test_securejoin.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -140,15 +140,15 @@ def get_broadcast(ac):
140140
return chat
141141

142142
def wait_for_broadcast_messages(ac):
143-
chat = get_broadcast(ac)
143+
snapshot1 = ac.wait_for_incoming_msg().get_snapshot()
144+
assert snapshot1.text == "You joined the channel."
144145

145-
snapshot = ac.wait_for_incoming_msg().get_snapshot()
146-
assert snapshot.text == "You joined the channel."
147-
assert snapshot.chat_id == chat.id
146+
snapshot2 = ac.wait_for_incoming_msg().get_snapshot()
147+
assert snapshot2.text == "Hello everyone!"
148148

149-
snapshot = ac.wait_for_incoming_msg().get_snapshot()
150-
assert snapshot.text == "Hello everyone!"
151-
assert snapshot.chat_id == chat.id
149+
chat = get_broadcast(ac)
150+
assert snapshot1.chat_id == chat.id
151+
assert snapshot2.chat_id == chat.id
152152

153153
def check_account(ac, contact, inviter_side, please_wait_info_msg=False):
154154
# Check that the chat partner is verified.

0 commit comments

Comments
 (0)