(predicate, timeout: float = 5.0)
| 663 | |
| 664 | |
| 665 | async def wait_for_predicate(predicate, timeout: float = 5.0) -> None: |
| 666 | deadline = asyncio.get_running_loop().time() + timeout |
| 667 | while asyncio.get_running_loop().time() < deadline: |
| 668 | if await predicate(): |
| 669 | return |
| 670 | await asyncio.sleep(0.1) |
| 671 | raise TimeoutError("timed out waiting for condition") |
no test coverage detected
searching dependent graphs…