(cloudflared)
| 13 | |
| 14 | |
| 15 | def assert_log_to_terminal(cloudflared): |
| 16 | # All logs are drained by a background thread into cloudflared.stdout_lines. |
| 17 | # Poll the accumulated lines until the expected message appears. |
| 18 | deadline = time.monotonic() + LOG_POLL_TIMEOUT |
| 19 | while time.monotonic() < deadline: |
| 20 | for line in list(cloudflared.stdout_lines): |
| 21 | if expect_message.encode() in line: |
| 22 | return |
| 23 | time.sleep(LOG_POLL_INTERVAL) |
| 24 | raise Exception(f"terminal log doesn't contain {expect_message}") |
| 25 | |
| 26 | |
| 27 | def assert_log_in_file(file): |
no test coverage detected
searching dependent graphs…