MCPcopy Create free account
hub / github.com/cloudflare/cloudflared / assert_log_to_terminal

Function assert_log_to_terminal

component-tests/test_logging.py:15–24  ·  view source on GitHub ↗
(cloudflared)

Source from the content-addressed store, hash-verified

13
14
15def 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
27def assert_log_in_file(file):

Callers 1

Calls 1

encodeMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…