Skip to content

Commit 3d19996

Browse files
committed
test: fix test_logged_ac_process_ffi_failure flakiness
This test keeps failing on macOS CI, capturing events like `DC_EVENT_ACCOUNTS_ITEM_CHANGED` before FailPlugin is setup. These CI runners likely get less resources because there is a limited number of them, and this triggers this race condition. Race is fixed by setting up fail plugin before starting to capture events.
1 parent 7e5cec6 commit 3d19996

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

python/tests/test_4_lowlevel.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -212,8 +212,13 @@ def ac_process_ffi_event(ffi_event):
212212
0 / 0
213213

214214
cap = Queue()
215-
ac1.log = cap.put
215+
216+
# Make sure the next attempt to log an event fails.
216217
ac1.add_account_plugin(FailPlugin())
218+
219+
# Start capturing events.
220+
ac1.log = cap.put
221+
217222
# cause any event eg contact added/changed
218223
ac1.create_contact("something@example.org")
219224
res = cap.get(timeout=10)

0 commit comments

Comments
 (0)