Skip to content

Commit bc48b17

Browse files
committed
test: Fix flaky test_no_old_msg_is_fresh: Wait for incoming message before sending outgoing one
We don't want to send an outgoing message from the 2nd device (`ac1_clone`) before receiving the incoming one and expect that the messages will be ordered correctly on the 1st device (`ac1`). Let's ensure the correct message order locally in the first place. I checked logs of a failed test run and it indeed happened that `ac1_clone` sent the message earlier, so it can't reference the incoming message and `tweak_sort_timestamp()` does nothing on `ac1`, so the messages can't be ordered correctly considering that smeared clocks on the devices are diferent.
1 parent 7233b4b commit bc48b17

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

deltachat-rpc-client/tests/test_something.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1047,6 +1047,7 @@ def test_no_old_msg_is_fresh(acfactory):
10471047
assert ac1.create_chat(ac2).get_fresh_message_count() == 1
10481048
assert len(list(ac1.get_fresh_messages())) == 1
10491049

1050+
ac1_clone.wait_for_incoming_msg_event()
10501051
ac1.wait_for_event(EventType.IMAP_INBOX_IDLE)
10511052

10521053
logging.info("Send a message from ac1_clone to ac2 and check that ac1 marks the first message as 'noticed'")

0 commit comments

Comments
 (0)