(pid: number, timeoutMs: number)
| 26 | const FORCE_STOP_POLL_INTERVAL_MS = 50; |
| 27 | |
| 28 | async function waitForPidExit(pid: number, timeoutMs: number): Promise<boolean> { |
| 29 | const deadline = Date.now() + timeoutMs; |
| 30 | while (Date.now() < deadline) { |
| 31 | if (!isPidAlive(pid)) { |
| 32 | return true; |
| 33 | } |
| 34 | await new Promise((resolveDelay) => setTimeout(resolveDelay, FORCE_STOP_POLL_INTERVAL_MS)); |
| 35 | } |
| 36 | return !isPidAlive(pid); |
| 37 | } |
| 38 | |
| 39 | function validateCurrentRegistryEntry( |
| 40 | expectedEntry: DaemonRegistryEntry, |
no test coverage detected