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

Function waitForProcessExit

tests/e2e/telemetry.test.ts:126–138  ·  view source on GitHub ↗
(
  pid: number,
  timeoutMs = 5000,
)

Source from the content-addressed store, hash-verified

124}
125
126async function waitForProcessExit(
127 pid: number,
128 timeoutMs = 5000,
129): Promise<void> {
130 const startTime = Date.now();
131 while (Date.now() - startTime < timeoutMs) {
132 if (!isProcessAlive(pid)) {
133 return;
134 }
135 await new Promise(resolve => setTimeout(resolve, 50));
136 }
137 throw new Error(`Timeout waiting for process ${pid} to exit`);
138}
139
140function cleanupTest(ctx: TestContext): void {
141 // Kill Main Process

Callers 1

runTelemetryTestFunction · 0.85

Calls 1

isProcessAliveFunction · 0.85

Tested by

no test coverage detected