@retry(exception=AssertionError, logfun=None, timeout=GLOBAL_TIMEOUT, interval=0.001)
def call_until(fun, expr):
 ret = fun()
 assert eval(expr)
 return ret

@ retry ( exception = AssertionError , logfun = None , timeout = GLOBAL_TIMEOUT , interval = 0.001 ) def call_until ( fun , expr ) : ret = fun ( ) assert eval ( expr ) return ret
keep calling function for timeout secs and exit if eval() expression is true .