Skip to content

Commit

Permalink
test: fix test_logged_ac_process_ffi_failure flakiness
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
link2xt committed Jan 5, 2025
1 parent 7e5cec6 commit 3d19996
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion python/tests/test_4_lowlevel.py
Original file line number Diff line number Diff line change
Expand Up @@ -212,8 +212,13 @@ def ac_process_ffi_event(ffi_event):
0 / 0

cap = Queue()
ac1.log = cap.put

# Make sure the next attempt to log an event fails.
ac1.add_account_plugin(FailPlugin())

# Start capturing events.
ac1.log = cap.put

# cause any event eg contact added/changed
ac1.create_contact("[email protected]")
res = cap.get(timeout=10)
Expand Down

0 comments on commit 3d19996

Please sign in to comment.