Add exception logging in flaky decorator

This commit is contained in:
Erik Johnson 2018-09-28 21:23:13 -05:00 committed by Ch3LL
parent 0ba0ddf8fa
commit 982e693ef6
No known key found for this signature in database
GPG key ID: 132B55A7C13EFA73

View file

@ -211,7 +211,10 @@ def flaky(caller=None, condition=True, attempts=4):
if attempt >= attempts -1:
raise exc
backoff_time = attempt ** 2
log.info('Found Exception. Waiting %s seconds to retry.', backoff_time)
log.info(
'Found Exception. Waiting %s seconds to retry.',
backoff_time
)
time.sleep(backoff_time)
return cls
return wrap