(instance, waitForLog = true)
| 12 | common.skipIfInspectorDisabled(); |
| 13 | |
| 14 | async function getDebuggedPid(instance, waitForLog = true) { |
| 15 | const session = await instance.connectInspectorSession(); |
| 16 | await session.send({ method: 'Runtime.enable' }); |
| 17 | if (waitForLog) { |
| 18 | await session.waitForConsoleOutput('log', 'safe to debug now'); |
| 19 | } |
| 20 | const { value: innerPid } = (await session.send({ |
| 21 | 'method': 'Runtime.evaluate', 'params': { 'expression': 'process.pid' }, |
| 22 | })).result; |
| 23 | session.disconnect(); |
| 24 | return innerPid; |
| 25 | } |
| 26 | |
| 27 | // Triggers a single restart and resolves when the restarted child prints "safe to debug now". |
| 28 | function restartAndWaitForReady(file, instance) { |
no test coverage detected
searching dependent graphs…