(
wait_cond, timeout, poll=0.1, msg="expected condition not met within timeout"
)
| 12 | |
| 13 | |
| 14 | def until( |
| 15 | wait_cond, timeout, poll=0.1, msg="expected condition not met within timeout" |
| 16 | ): # noqa: C0330 |
| 17 | res = wait_cond() |
| 18 | logger.debug( |
| 19 | "start wait.until with method, timeout, poll => %s %s %s", |
| 20 | wait_cond, |
| 21 | timeout, |
| 22 | poll, |
| 23 | ) |
| 24 | end_time = time.time() + timeout |
| 25 | while not res: |
| 26 | if time.time() > end_time: |
| 27 | raise TestingTimeoutError(msg) |
| 28 | time.sleep(poll) |
| 29 | res = wait_cond() |
| 30 | logger.debug("poll => %s", time.time()) |
| 31 | |
| 32 | return res |
| 33 | |
| 34 | |
| 35 | def until_not( |
searching dependent graphs…