Decrease time.sleep times in tests to save 60 seconds for test-suite run.

This commit is contained in:
Jan Kaluza
2018-02-08 09:03:32 +01:00
parent bc3412683a
commit 683056de0a
3 changed files with 9 additions and 6 deletions

View File

@@ -62,14 +62,14 @@ def retry(timeout=conf.net_timeout, interval=conf.net_retry_interval, wait_on=Ex
def inner(*args, **kwargs):
start = time.time()
while True:
if (time.time() - start) >= timeout:
raise # This re-raises the last exception.
try:
return function(*args, **kwargs)
except wait_on as e:
log.warn("Exception %r raised from %r. Retry in %rs" % (
e, function, interval))
time.sleep(interval)
if (time.time() - start) >= timeout:
raise # This re-raises the last exception.
return inner
return wrapper