MCPcopy Create free account
hub / github.com/colbymchenry/codegraph / waitForExit

Function waitForExit

__tests__/index-orphan-watchdog.test.ts:28–38  ·  view source on GitHub ↗
(pid: number, timeoutMs: number)

Source from the content-addressed store, hash-verified

26}
27
28function waitForExit(pid: number, timeoutMs: number): Promise<boolean> {
29 return new Promise((resolve) => {
30 const start = Date.now();
31 const tick = () => {
32 if (!isAlive(pid)) return resolve(true);
33 if (Date.now() - start > timeoutMs) return resolve(false);
34 setTimeout(tick, 100);
35 };
36 tick();
37 });
38}
39
40describe.skipIf(process.platform === 'win32')('index/init orphan supervision (#999)', () => {
41 let wrapper: ChildProcessWithoutNullStreams | null = null;

Callers 1

Calls 1

tickFunction · 0.70

Tested by

no test coverage detected