diff --git a/python/src/deltachat/testplugin.py b/python/src/deltachat/testplugin.py index 591cd6a9e..a8b4386c1 100644 --- a/python/src/deltachat/testplugin.py +++ b/python/src/deltachat/testplugin.py @@ -396,15 +396,18 @@ def acfactory(pytestconfig, tmpdir, request, session_liveconfig, data): ac2.create_chat(ac1) return ac1.create_chat(ac2) - def accept_each_other(self, accounts, sending=False): + def introduce_each_other(self, accounts, sending=True): + to_wait = [] for i, acc in enumerate(accounts): for acc2 in accounts[i + 1:]: chat = self.get_accepted_chat(acc, acc2) if sending: chat.send_text("hi") - acc2._evtracker.wait_next_incoming_message() + to_wait.append(acc2) acc2.create_chat(acc).send_text("hi back") - acc._evtracker.wait_next_incoming_message() + to_wait.append(acc) + for acc in to_wait: + acc._evtracker.wait_next_incoming_message() am = AccountMaker() request.addfinalizer(am.finalize) diff --git a/python/tests/test_account.py b/python/tests/test_account.py index 03002cc46..1028d98c6 100644 --- a/python/tests/test_account.py +++ b/python/tests/test_account.py @@ -1508,7 +1508,7 @@ class TestOnlineAccount: lp.sec("creating and configuring three accounts") ac1, ac2, ac3 = acfactory.get_many_online_accounts(3) - acfactory.accept_each_other([ac1, ac2, ac3], sending=True) + acfactory.introduce_each_other([ac1, ac2, ac3]) lp.sec("ac3 reinstalls DC and generates a new key") ac3.stop_io() @@ -1568,7 +1568,7 @@ class TestOnlineAccount: class TestGroupStressTests: def test_group_many_members_add_leave_remove(self, acfactory, lp): accounts = acfactory.get_many_online_accounts(5) - acfactory.accept_each_other(accounts, sending=True) + acfactory.introduce_each_other(accounts) ac1, ac5 = accounts.pop(), accounts.pop() lp.sec("ac1: creating group chat with 3 other members") @@ -1641,7 +1641,7 @@ class TestGroupStressTests: """ lp.sec("setting up accounts, accepted with each other") accounts = acfactory.get_many_online_accounts(3) - acfactory.accept_each_other(accounts, sending=True) + acfactory.introduce_each_other(accounts) ac1, ac2, ac3 = accounts lp.sec("ac1: creating group chat with 2 other members")