run_iocsh.utils

Standalone utilities for run-iocsh.

Attributes

log

Functions

wait_for(→ None)

Poll predicate until it returns True or timeout elapses.

Module Contents

run_iocsh.utils.log[source]
run_iocsh.utils.wait_for(predicate: collections.abc.Callable[[], bool], timeout: float = DEFAULT_WAIT_FOR_TIMEOUT, poll_interval: float = DEFAULT_POLL_INTERVAL) None[source]

Poll predicate until it returns True or timeout elapses.

Exceptions from predicate are caught and treated as a false result (polling continues until timeout).

Args:

predicate: Callable invoked repeatedly; success when it returns True. timeout: Maximum seconds to wait before giving up. poll_interval: Seconds to sleep between polls.

Raises:

TimeoutError: If the predicate never returns True within timeout.