(pid: number, signal: string)
| 160 | const _promisifiedTreeKill = promisify(treeKill) as (pid: number, signal: string) => Promise<void>; |
| 161 | |
| 162 | export const promisifiedTreeKill = async (pid: number, signal: string) => { |
| 163 | try { |
| 164 | return await _promisifiedTreeKill(pid, signal); |
| 165 | } catch (error) { |
| 166 | // Don't treat process termination failures as test failures |
| 167 | // This is especially important on Windows where processes may already be gone |
| 168 | // or may not be properly terminated with tree-kill |
| 169 | log(`Process ${pid} could not be killed, but continuing: ${error.message}`); |
| 170 | return Promise.resolve(); |
| 171 | } |
| 172 | }; |
| 173 | |
| 174 | export async function killAllRegisteredProcesses() { |
| 175 | const pIds = (global?.pIds as number[]) ?? []; |
no test coverage detected
searching dependent graphs…