Improve timeout handling (fix an infinite loop)
Check for the timeout should not be under `except`.
Slightly adjust the debug message wording.
@@ -255,10 +255,12 @@ class GuestTestcloud(tmt.Guest):
if response.ok:
return response
except requests.RequestException:
+ pass
if timeout < 0:
raise ProvisionError(
- f'Failed to connect in {DEFAULT_CONNECT_TIMEOUT}s.')
- self.debug(f'Unable to {message} ({url}). Retrying... '
+ f'Failed to {message} in {DEFAULT_CONNECT_TIMEOUT}s.')
+ self.debug(
+ f'Unable to {message} ({url}), retrying, '
f'{fmf.utils.listed(timeout, "second")} left.')
time.sleep(wait)
wait += 1
