MCPcopy Create free account
hub / github.com/ddnet/ddnet / wait_for_log

Method wait_for_log

scripts/integration_test.py:391–399  ·  view source on GitHub ↗
(self, fn, description, timeout=1)

Source from the content-addressed store, hash-verified

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)

Callers 4

wait_for_log_prefixMethod · 0.95
wait_for_log_suffixMethod · 0.95
wait_for_log_exactMethod · 0.95
smoke_testFunction · 0.80

Calls 2

register_timeoutMethod · 0.95
next_eventMethod · 0.95

Tested by

no test coverage detected