MCPcopy Index your code
hub / github.com/cloudflare/cloudflared / cleanup

Method cleanup

component-tests/util.py:52–65  ·  view source on GitHub ↗

Terminate, wait for exit, join reader threads, and log output.

(self)

Source from the content-addressed store, hash-verified

50 self.process.terminate()
51
52 def cleanup(self):
53 """Terminate, wait for exit, join reader threads, and log output."""
54 self.terminate()
55 try:
56 self.process.wait(timeout=GRACEFUL_SHUTDOWN_TIMEOUT)
57 except subprocess.TimeoutExpired:
58 self.process.kill()
59 self.process.wait()
60 for t in self._threads:
61 t.join(timeout=READER_THREAD_JOIN_TIMEOUT)
62 if self._capture_output:
63 stdout = b"".join(self._stdout_lines).decode("utf-8", errors="replace")
64 if stdout:
65 LOGGER.info(f"cloudflared stdout:\n{stdout}")
66
67 @property
68 def stdout_lines(self):

Callers 2

__exit__Method · 0.45

Calls 2

terminateMethod · 0.95
waitMethod · 0.80

Tested by

no test coverage detected