From f40b5ae7198db2df4ee26126df13dc931244c3bb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=F0=9D=94=A0=F0=9D=94=A0=F0=9D=94=A0=F0=9D=94=A9?= =?UTF-8?q?=F0=9D=94=B5=F0=9D=94=B5=F0=9D=94=A6=F0=9D=94=A6=F0=9D=94=A6?= <151577046+ccclxxiii@users.noreply.github.com> Date: Thu, 28 May 2026 12:49:03 +0000 Subject: [PATCH 1/3] test: avoid race in sender ip cleanup imap check --- .../cmdeploy/tests/online/test_2_deltachat.py | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/cmdeploy/src/cmdeploy/tests/online/test_2_deltachat.py b/cmdeploy/src/cmdeploy/tests/online/test_2_deltachat.py index 9cf79ffce..aa0a2f999 100644 --- a/cmdeploy/src/cmdeploy/tests/online/test_2_deltachat.py +++ b/cmdeploy/src/cmdeploy/tests/online/test_2_deltachat.py @@ -167,7 +167,6 @@ def test_read_receipts_between_instances(self, cmfactory, lp, maildomain2): assert "error" not in m.get_info() time.sleep(1) - def test_hide_senders_ip_address(cmfactory, ssl_context): public_ip = requests.get("http://icanhazip.com").content.decode().strip() assert ipaddress.ip_address(public_ip) @@ -175,13 +174,23 @@ 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: + msgs = list(mailbox.fetch(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() From 7bbf35796db45f7fa114703c2f570a916741dce7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=F0=9D=94=A0=F0=9D=94=A0=F0=9D=94=A0=F0=9D=94=A9?= =?UTF-8?q?=F0=9D=94=B5=F0=9D=94=B5=F0=9D=94=A6=F0=9D=94=A6=F0=9D=94=A6?= <151577046+ccclxxiii@users.noreply.github.com> Date: Thu, 28 May 2026 13:01:25 +0000 Subject: [PATCH 2/3] test: [wip] debug trace --- cmdeploy/src/cmdeploy/tests/plugin.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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: From 10528d0a86466975ed692f2a0e3f11d3c23e891d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=F0=9D=94=A0=F0=9D=94=A0=F0=9D=94=A0=F0=9D=94=A9?= =?UTF-8?q?=F0=9D=94=B5=F0=9D=94=B5=F0=9D=94=A6=F0=9D=94=A6=F0=9D=94=A6?= <151577046+ccclxxiii@users.noreply.github.com> Date: Thu, 28 May 2026 13:16:17 +0000 Subject: [PATCH 3/3] test: poll inbox directly in hide_senders_ip_address --- cmdeploy/src/cmdeploy/tests/online/test_2_deltachat.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/cmdeploy/src/cmdeploy/tests/online/test_2_deltachat.py b/cmdeploy/src/cmdeploy/tests/online/test_2_deltachat.py index aa0a2f999..964e98735 100644 --- a/cmdeploy/src/cmdeploy/tests/online/test_2_deltachat.py +++ b/cmdeploy/src/cmdeploy/tests/online/test_2_deltachat.py @@ -167,6 +167,7 @@ def test_read_receipts_between_instances(self, cmfactory, lp, maildomain2): assert "error" not in m.get_info() time.sleep(1) + def test_hide_senders_ip_address(cmfactory, ssl_context): public_ip = requests.get("http://icanhazip.com").content.decode().strip() assert ipaddress.ip_address(public_ip) @@ -187,10 +188,11 @@ def test_hide_senders_ip_address(cmfactory, ssl_context): msgs = [] while time.time() < deadline: - msgs = list(mailbox.fetch(mark_seen=False)) + 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()