From 3c5ceff85fb90b265a85270bba38085f45c7f25e Mon Sep 17 00:00:00 2001 From: Luigi Pinca Date: Tue, 24 Sep 2024 07:53:45 +0200 Subject: [PATCH] test: deflake test-inspector-strip-types Use the `NodeRuntime.waitingForDebugger` event. Refs: https://github.com/nodejs/node/pull/51560 PR-URL: https://github.com/nodejs/node/pull/55058 Reviewed-By: Antoine du Hamel Reviewed-By: Chemi Atlow Reviewed-By: Chengzhong Wu --- 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;