diff --git a/rhodecode/tests/utils.py b/rhodecode/tests/utils.py --- a/rhodecode/tests/utils.py +++ b/rhodecode/tests/utils.py @@ -397,20 +397,21 @@ def wait_for_url(url, timeout=10): while timeout > last: last = time.time() - if is_url_reachable(url): + if is_url_reachable(url, log_exc=False): break elif (last + wait) > time.time(): # Go to sleep because not enough time has passed since last check. time.sleep(wait) else: - pytest.fail("Timeout while waiting for URL {}".format(url)) + pytest.fail(f"Timeout while waiting for URL {url}") -def is_url_reachable(url): +def is_url_reachable(url: str, log_exc: bool = True) -> bool: try: urllib.request.urlopen(url) except urllib.error.URLError: - log.exception('URL `{}` reach error'.format(url)) + if log_exc: + log.exception('URL `{}` reach error'.format(url)) return False return True