From 36958af4dc04faac6267faf66fbdbf78f2cdc13e Mon Sep 17 00:00:00 2001 From: Filip Skokan Date: Sat, 26 Sep 2026 11:19:12 +0200 Subject: [PATCH] test: deflake inspector close connection test Wait for NodeRuntime.waitingForDebugger before sending the resume command. Runtime.executionContextCreated does not guarantee that the child has started waiting for the debugger. Signed-off-by: Filip Skokan Assisted-by: Codex --- test/parallel/test-inspector-close-terminate-connections.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/test/parallel/test-inspector-close-terminate-connections.js b/test/parallel/test-inspector-close-terminate-connections.js index ab18ad277db..e055044506b 100644 --- a/test/parallel/test-inspector-close-terminate-connections.js +++ b/test/parallel/test-inspector-close-terminate-connections.js @@ -18,9 +18,9 @@ async function test() { const instance = new NodeInstance(['--inspect-brk=0'], script); const session = await instance.connectInspectorSession(); - // Enable Runtime domain and wait for an event to confirm the session is live. - await session.send({ method: 'Runtime.enable' }); - await session.waitForNotification('Runtime.executionContextCreated'); + // Wait until the child is ready to receive the resume command. + await session.send({ method: 'NodeRuntime.enable' }); + await session.waitForNotification('NodeRuntime.waitingForDebugger'); // Resume execution so the script calls inspector.close(). await session.send({ method: 'Runtime.runIfWaitingForDebugger' });