def wait_for(self, condition: Callable[([], bool)], timeout: Optional=None, max_iterations: int=10000):
    '\n        Advance time in steps until condition is reached, running scheduled callbacks in process\n        Throws TimeoutError if fail to reach condition (under required timeout if defined)\n        '
    counter = 0
    deadline = ((self._ts.value + timeout) if timeout else None)
    while (self._events and (not condition()) and (counter < max_iterations)):
        if (deadline and (self._next_timestamp() > deadline)):
            raise TimeoutError('Failed to reach condition in required time, {} iterations passed'.format(counter))
        self.advance()
        counter += 1
    if (not condition()):
        if (not self._events):
            raise TimeoutError('Condition will be never reached, {} iterations passed'.format(counter))
        else:
            raise TimeoutError('Failed to reach condition in {} iterations'.format(max_iterations))
Advance time in steps until condition is reached, running scheduled callbacks in process
Throws TimeoutError if fail to reach condition (under required timeout if defined)
def wait_for(self, condition: Callable[([], bool)], timeout: Optional=None, max_iterations: int=10000):
    '\n        Advance time in steps until condition is reached, running scheduled callbacks in process\n        Throws TimeoutError if fail to reach condition (under required timeout if defined)\n        '
    counter = 0
    deadline = ((self._ts.value + timeout) if timeout else None)
    while (self._events and (not condition()) and (counter < max_iterations)):
        if (deadline and (self._next_timestamp() > deadline)):
            raise TimeoutError('Failed to reach condition in required time, {} iterations passed'.format(counter))
        self.advance()
        counter += 1
    if (not condition()):
        if (not self._events):
            raise TimeoutError('Condition will be never reached, {} iterations passed'.format(counter))
        else:
            raise TimeoutError('Failed to reach condition in {} iterations'.format(max_iterations))