(pid: number, timeout: number)
| 310 | } |
| 311 | |
| 312 | async function waitForProcessDeath(pid: number, timeout: number): Promise<void> { |
| 313 | const start = Date.now(); |
| 314 | while (Date.now() - start < timeout) { |
| 315 | if (isProcessAlive(pid)) { |
| 316 | await new Promise(resolve => setTimeout(resolve, 100)); |
| 317 | continue; |
| 318 | } |
| 319 | return; // Process is dead |
| 320 | } |
| 321 | throw new Error('Process did not die within timeout'); |
| 322 | } |
no test coverage detected