From d1f4a318876eab68b71166aedf8c4295ed36aabd Mon Sep 17 00:00:00 2001 From: Luigi Pinca Date: Sun, 22 Sep 2024 07:29:32 +0200 Subject: [PATCH] test: deflake test-inspector-strip-types Use the `NodeRuntime.waitingForDebugger` event. Refs: https://github.com/nodejs/node/pull/51560 --- test/parallel/test-inspector-strip-types.js | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/test/parallel/test-inspector-strip-types.js b/test/parallel/test-inspector-strip-types.js index 68e2463d530e8f..c03a58345e59f9 100644 --- a/test/parallel/test-inspector-strip-types.js +++ b/test/parallel/test-inspector-strip-types.js @@ -18,13 +18,14 @@ async function runTest() { const session = await child.connectInspectorSession(); - const commands = [ + await session.send({ method: 'NodeRuntime.enable' }); + await session.waitForNotification('NodeRuntime.waitingForDebugger'); + await session.send([ { 'method': 'Debugger.enable' }, { 'method': 'Runtime.enable' }, { 'method': 'Runtime.runIfWaitingForDebugger' }, - ]; - - await session.send(commands); + ]); + await session.send({ method: 'NodeRuntime.disable' }); const scriptParsed = await session.waitForNotification((notification) => { if (notification.method !== 'Debugger.scriptParsed') return false;