diff --git a/cmdeploy/src/cmdeploy/tests/online/test_2_deltachat.py b/cmdeploy/src/cmdeploy/tests/online/test_2_deltachat.py index 9cf79ffce..964e98735 100644 --- a/cmdeploy/src/cmdeploy/tests/online/test_2_deltachat.py +++ b/cmdeploy/src/cmdeploy/tests/online/test_2_deltachat.py @@ -175,13 +175,24 @@ def test_hide_senders_ip_address(cmfactory, ssl_context): user1, user2 = cmfactory.get_online_accounts(2) chat = cmfactory.get_accepted_chat(user1, user2) - chat.send_text("testing submission header cleanup") - user2.wait_for_incoming_msg() addr = user2.get_config("addr") host = addr.split("@")[1].strip("[").strip("]") pw = user2.get_config("mail_pw") + mailbox = imap_tools.MailBox(host, ssl_context=ssl_context) mailbox.login(addr, pw) - msgs = list(mailbox.fetch(mark_seen=False)) + + chat.send_text("testing submission header cleanup") + + deadline = time.time() + 10 + msgs = [] + + while time.time() < deadline: + mailbox.folder.set("INBOX") + msgs = list(mailbox.fetch(criteria="ALL", mark_seen=False)) + if msgs: + break + time.sleep(0.5) + assert msgs, "expected at least one message" - assert public_ip not in msgs[0].obj.as_string() + assert public_ip not in msgs[-1].obj.as_string() diff --git a/cmdeploy/src/cmdeploy/tests/plugin.py b/cmdeploy/src/cmdeploy/tests/plugin.py index c61b44264..a0c59115b 100644 --- a/cmdeploy/src/cmdeploy/tests/plugin.py +++ b/cmdeploy/src/cmdeploy/tests/plugin.py @@ -362,7 +362,8 @@ def get_online_accounts(self, num, domain=None): # ensure messages stay in INBOX so that they can be # concurrently fetched via extra IMAP connections during tests - account.set_config("delete_server_after", "10") + # commented out to validate ci failure trace + # account.set_config("delete_server_after", "10") accounts.append(account) for future in futures: