(pid: number, signal: NodeJS.Signals)
| 76 | } |
| 77 | |
| 78 | function trySignalProcess(pid: number, signal: NodeJS.Signals): boolean { |
| 79 | try { |
| 80 | process.kill(pid, signal); |
| 81 | return true; |
| 82 | } catch (err) { |
| 83 | const code = (err as NodeJS.ErrnoException).code; |
| 84 | if (code === 'ESRCH' || code === 'EPERM') return false; |
| 85 | throw err; |
| 86 | } |
| 87 | } |
| 88 | |
| 89 | export async function waitForProcessExit(pid: number, timeoutMs: number): Promise<boolean> { |
| 90 | if (!isProcessAlive(pid)) return true; |
no test coverage detected