MCPcopy Create free account
hub / github.com/UsefulSoftwareCo/executor / waitForGuestHealth

Function waitForGuestHealth

e2e/cli/service-install-takeover.test.ts:81–90  ·  view source on GitHub ↗
(expected: boolean)

Source from the content-addressed store, hash-verified

79 : `curl -s -o /dev/null -w '%{http_code}' --max-time 3 http://127.0.0.1:${PORT}/api/health`;
80
81const waitForGuestHealth = async (expected: boolean): Promise<boolean> => {
82 const deadline = Date.now() + 30_000;
83 for (;;) {
84 const result = await ssh(healthStatusCommand());
85 const healthy = result.stdout.trim() === "200";
86 if (healthy === expected) return true;
87 if (Date.now() >= deadline) return false;
88 await new Promise((resolve) => setTimeout(resolve, 500));
89 }
90};
91
92const listenerPid = async (): Promise<string> =>
93 (

Calls 2

healthStatusCommandFunction · 0.85
sshFunction · 0.70

Tested by

no test coverage detected