Add some logs with info about process retry loop

Tobiko does not print any information about the status of this loop
because the sleep_interval is None.
After one hour, the retry loop is broken because the timeout expires,
but there is no information about the reason why it expired.
With this patch, information about the timeout and the retry loop is
printed within the Tobiko logs.

Change-Id: I74e97bf251bbb0180b26d7111bde52663cee2406
This commit is contained in:
Eduardo Olivares 2023-08-23 13:16:03 +02:00
parent cc3c91acd7
commit 89f94d21cd
2 changed files with 4 additions and 1 deletions

View File

@ -201,6 +201,9 @@ class Retry(object):
_time.sleep(sleep_time)
elapsed_time = _time.time() - start_time
if not sleep_time: # sleep_time is None or 0.
LOG.debug(f"retrying without waiting... ({attempt.details})")
@property
def details(self) -> str:
details = []

View File

@ -349,7 +349,7 @@ class ShellProcessFixture(tobiko.SharedFixture):
try:
attempt.check_limits()
except tobiko.RetryTimeLimitError:
pass
LOG.exception("retry timeout expired")
else:
return
# Eventually raises ShellCommandTimeout exception