Commit 8c4c880e authored by Vincent Pelletier's avatar Vincent Pelletier

test: Increase default timeout.

To accommodate with slower machines, which are a reasonable target for
caucase.
Caucase tests do not timeout anymore on a Raspberry Pi B+.
parent 1338ac4f
......@@ -64,7 +64,7 @@ def canConnect(address):
raise
return True
def retry(callback, try_count=10, try_delay=0.1):
def retry(callback, try_count=200, try_delay=0.1):
"""
Poll <callback> every <try_delay> for <try_count> times or until it returns
a true value.
......@@ -134,7 +134,6 @@ class CaucaseTest(unittest.TestCase):
key_path,
new_csr_path,
new_key_path,
try_count=10,
):
"""
Start caucased in its special --restore-backup mode. It will exit once
......@@ -162,10 +161,8 @@ class CaucaseTest(unittest.TestCase):
server.daemon = True
server.start()
# Must exit after a (short) while
if not retry(lambda: not server.is_alive(), try_count=try_count):
raise AssertionError('Backup restoration took more than %i second' % (
try_count / 10,
))
if not retry(lambda: not server.is_alive(), try_count=400):
raise AssertionError('Backup restoration took too long')
return server.exitcode
def _startServer(self, *argv):
......@@ -1529,9 +1526,9 @@ class CaucaseTest(unittest.TestCase):
db.close()
del db
self._startServer('--backup-directory', self._server_backup_path)
backup_path_list = retry(lambda: glob.glob(backup_glob), try_count=20)
backup_path_list = retry(lambda: glob.glob(backup_glob), try_count=300)
if not backup_path_list:
raise AssertionError('Backup file not created after 2 second')
raise AssertionError('Backup file took too long to be created')
backup_path, = glob.glob(backup_glob)
cli.key_id([
'--backup', backup_path,
......@@ -1556,7 +1553,6 @@ class CaucaseTest(unittest.TestCase):
user2_new_bare_key_path,
user2_newnew_csr_path,
user2_newnew_key_path,
try_count=50,
),
0,
)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment