Skip to content

Commit 36958af

Browse files
committed
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 <panva.ip@gmail.com> Assisted-by: Codex
1 parent 66f26d3 commit 36958af

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

‎test/parallel/test-inspector-close-terminate-connections.js‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,9 @@ async function test() {
1818
const instance = new NodeInstance(['--inspect-brk=0'], script);
1919
const session = await instance.connectInspectorSession();
2020

21-
// Enable Runtime domain and wait for an event to confirm the session is live.
22-
await session.send({ method: 'Runtime.enable' });
23-
await session.waitForNotification('Runtime.executionContextCreated');
21+
// Wait until the child is ready to receive the resume command.
22+
await session.send({ method: 'NodeRuntime.enable' });
23+
await session.waitForNotification('NodeRuntime.waitingForDebugger');
2424

2525
// Resume execution so the script calls inspector.close().
2626
await session.send({ method: 'Runtime.runIfWaitingForDebugger' });

0 commit comments

Comments
 (0)