renamings and parallel sending

This commit is contained in:
holger krekel
2020-06-09 13:33:52 +02:00
parent 0c8f951d8f
commit 0efb2215e4
2 changed files with 9 additions and 6 deletions

View File

@@ -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)

View File

@@ -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")