(self, fn, description, timeout=1)
| 389 | event.raise_on_error(None) |
| 390 | |
| 391 | def wait_for_log(self, fn, description, timeout=1): |
| 392 | timeout_id = self.register_timeout(timeout, description) |
| 393 | while True: |
| 394 | event = self.next_event(timeout_id) |
| 395 | if isinstance(event, Exit): |
| 396 | raise EOFError(f"program exited unexpectedly waiting for {description}") |
| 397 | elif isinstance(event, Log): |
| 398 | if fn(event): |
| 399 | return event |
| 400 | |
| 401 | def wait_for_log_prefix(self, prefix, timeout=1): |
| 402 | self.wait_for_log(lambda l: l.line.startswith(prefix), description=f"log line with prefix `{prefix}`", timeout=timeout) |
no test coverage detected