def retry(self, method_to_check, retry_timeout=RETRY_TIMEOUT,
              retry_interval=RETRY_INTERVAL):
        time_spent_waiting = 0
        while time_spent_waiting <= retry_timeout:
            try:
                result = method_to_check()
                # No exception thrown, success
                return result
            except (AssertionError, PrestoError, OSError):
                pass
            sleep(retry_interval)
            time_spent_waiting += retry_interval
        return method_to_check()
dataset/ETHPy150Open prestodb/presto-admin/tests/product/base_product_case.py/BaseProductTestCase.retry/original