mirror of
https://github.com/chatmail/core.git
synced 2026-04-17 21:46:35 +03:00
the test machinery is too stateful in waiting for account configure+start -- tests from deltabot got into a deadlock while setting up accounts. Be more specific with the "get online acocunt" helpers.
This commit is contained in:
@@ -312,19 +312,19 @@ def acfactory(pytestconfig, tmpdir, request, session_liveconfig, data):
|
|||||||
def get_one_online_account(self, pre_generated_key=True, mvbox=False, move=False):
|
def get_one_online_account(self, pre_generated_key=True, mvbox=False, move=False):
|
||||||
ac1 = self.get_online_configuring_account(
|
ac1 = self.get_online_configuring_account(
|
||||||
pre_generated_key=pre_generated_key, mvbox=mvbox, move=move)
|
pre_generated_key=pre_generated_key, mvbox=mvbox, move=move)
|
||||||
self.wait_configure_and_start_io()
|
self.wait_configure_and_start_io([ac1])
|
||||||
return ac1
|
return ac1
|
||||||
|
|
||||||
def get_two_online_accounts(self, move=False, quiet=False):
|
def get_two_online_accounts(self, move=False, quiet=False):
|
||||||
ac1 = self.get_online_configuring_account(move=move, quiet=quiet)
|
ac1 = self.get_online_configuring_account(move=move, quiet=quiet)
|
||||||
ac2 = self.get_online_configuring_account(quiet=quiet)
|
ac2 = self.get_online_configuring_account(quiet=quiet)
|
||||||
self.wait_configure_and_start_io()
|
self.wait_configure_and_start_io([ac1, ac2])
|
||||||
return ac1, ac2
|
return ac1, ac2
|
||||||
|
|
||||||
def get_many_online_accounts(self, num, move=True):
|
def get_many_online_accounts(self, num, move=True):
|
||||||
accounts = [self.get_online_configuring_account(move=move, quiet=True)
|
accounts = [self.get_online_configuring_account(move=move, quiet=True)
|
||||||
for i in range(num)]
|
for i in range(num)]
|
||||||
self.wait_configure_and_start_io()
|
self.wait_configure_and_start_io(accounts)
|
||||||
for acc in accounts:
|
for acc in accounts:
|
||||||
acc.add_account_plugin(FFIEventLogger(acc))
|
acc.add_account_plugin(FFIEventLogger(acc))
|
||||||
return accounts
|
return accounts
|
||||||
@@ -356,16 +356,19 @@ def acfactory(pytestconfig, tmpdir, request, session_liveconfig, data):
|
|||||||
ac._configtracker = ac.configure()
|
ac._configtracker = ac.configure()
|
||||||
return ac
|
return ac
|
||||||
|
|
||||||
def wait_configure_and_start_io(self):
|
def wait_configure_and_start_io(self, accounts=None):
|
||||||
|
if accounts is None:
|
||||||
|
accounts = self._accounts[:]
|
||||||
started_accounts = []
|
started_accounts = []
|
||||||
for acc in self._accounts:
|
for acc in accounts:
|
||||||
self.wait_configure(acc)
|
if acc not in started_accounts:
|
||||||
acc.set_config("bcc_self", "0")
|
self.wait_configure(acc)
|
||||||
if acc.is_configured() and acc not in started_accounts:
|
acc.set_config("bcc_self", "0")
|
||||||
acc.start_io()
|
if acc.is_configured():
|
||||||
started_accounts.append(acc)
|
acc.start_io()
|
||||||
print("{}: {} account was successfully setup".format(
|
started_accounts.append(acc)
|
||||||
acc.get_config("displayname"), acc.get_config("addr")))
|
print("{}: {} account was started".format(
|
||||||
|
acc.get_config("displayname"), acc.get_config("addr")))
|
||||||
for acc in started_accounts:
|
for acc in started_accounts:
|
||||||
acc._evtracker.wait_all_initial_fetches()
|
acc._evtracker.wait_all_initial_fetches()
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user