(capabilities: WebdriverIO.Capabilities, shutdownDriver: boolean)
| 8 | * @param shutdownDriver - whether to shutdown the driver |
| 9 | */ |
| 10 | export function killDriverProcess(capabilities: WebdriverIO.Capabilities, shutdownDriver: boolean) { |
| 11 | if (shutdownDriver && 'wdio:driverPID' in capabilities && capabilities['wdio:driverPID']) { |
| 12 | log.info(`Kill driver process with PID ${capabilities['wdio:driverPID']}`) |
| 13 | try { |
| 14 | const killedSuccessfully = process.kill(capabilities['wdio:driverPID'], 'SIGKILL') |
| 15 | if (!killedSuccessfully) { |
| 16 | log.warn('Failed to kill driver process, manually clean-up might be required') |
| 17 | } |
| 18 | } catch (err) { |
| 19 | log.warn('Failed to kill driver process', err) |
| 20 | } |
| 21 | |
| 22 | setTimeout(() => { |
| 23 | /** |
| 24 | * clear up potential leaked TLS Socket handles |
| 25 | * see https://github.com/puppeteer/puppeteer/pull/10667 |
| 26 | */ |
| 27 | for (const handle of process._getActiveHandles()) { |
| 28 | if (handle.servername && handle.servername.includes('edgedl.me')) { |
| 29 | handle.destroy() |
| 30 | } |
| 31 | } |
| 32 | }, 10) |
| 33 | } |
| 34 | } |
nothing calls this directly
no test coverage detected
searching dependent graphs…