tests/wait-for-services.py
def try_until_timeout(exception):
    """Utility decorator that tries to call a check until there is a
    timeout.  The default timeout is about 20 seconds.

    """
    def wrap(fn):
        err = None
        def wrapper(*args, **kwargs):
            for i in range(100):
                try:
                    fn()
                except exception as e:
                    err = e
                    time.sleep(0.2)
                else:
                    break
            else:
                if err:
                    raise err
        return wrapper
    return wrap
Utility decorator that tries to call a check until there is a
    timeout.  The default timeout is about 20 seconds.

    
Utility decorator that tries to call a check until there is a
timeout.  The default timeout is about 20 seconds.
Utility decorator that tries to call a check until there is a timeout . The default timeout is about 20 seconds .
def try_until_timeout(exception):
    def wrap(fn):
        err = None
        def wrapper(*args, **kwargs):
            for i in range(100):
                try:
                    fn()
                except exception as e:
                    err = e
                    time.sleep(0.2)
                else:
                    break
            else:
                if err:
                    raise err
        return wrapper
    return wrap
def try_until_timeout ( exception ) : def wrap ( fn ) : err = None def wrapper ( * args , ** kwargs ) : for i in range ( 100 ) : try : fn ( ) except exception as e : err = e time . sleep ( 0.2 ) else : break else : if err : raise err return wrapper return wrap
Utility decorator that tries to call a check until there is a
timeout.
Utility decorator that tries to call a check until there is a timeout .
"""Utility decorator that tries to call a check until there is a
    timeout.  The default timeout is about 20 seconds.

    """
exception