MCPcopy Create free account
hub / github.com/ChromeDevTools/chrome-devtools-mcp / waitForExit

Function waitForExit

tests/shutdown.test.ts:50–69  ·  view source on GitHub ↗
(
  child: Server,
  timeoutMs: number,
)

Source from the content-addressed store, hash-verified

48}
49
50async function waitForExit(
51 child: Server,
52 timeoutMs: number,
53): Promise<{
54 code: number | null;
55 signal: NodeJS.Signals | null;
56 elapsedMs: number;
57}> {
58 const start = Date.now();
59 return await new Promise((resolve, reject) => {
60 const timer = setTimeout(() => {
61 child.kill('SIGKILL');
62 reject(new Error(`server did not exit within ${timeoutMs}ms`));
63 }, timeoutMs);
64 child.once('exit', (code, signal) => {
65 clearTimeout(timer);
66 resolve({code, signal, elapsedMs: Date.now() - start});
67 });
68 });
69}
70
71async function rpc(
72 child: Server,

Callers 1

shutdown.test.tsFile · 0.85

Calls 2

rejectFunction · 0.85
resolveFunction · 0.85

Tested by

no test coverage detected