Skip to content

Commit 94f242c

Browse files
lpincatargos
authored andcommitted
test: reduce test-esm-loader-hooks-inspect-wait flakiness
Refs: #51560 PR-URL: #54827 Reviewed-By: Chengzhong Wu <[email protected]> Reviewed-By: James M Snell <[email protected]>
1 parent 729158c commit 94f242c

File tree

1 file changed

+8
-11
lines changed

1 file changed

+8
-11
lines changed

‎test/parallel/test-esm-loader-hooks-inspect-wait.js‎

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -10,22 +10,19 @@ const assert = require('assert');
1010
constfixtures=require('../common/fixtures');
1111
const{ NodeInstance }=require('../common/inspector-helper.js');
1212

13-
asyncfunctionrunIfWaitingForDebugger(session){
14-
constcommands=[
15-
{'method': 'Runtime.enable'},
16-
{'method': 'Debugger.enable'},
17-
{'method': 'Runtime.runIfWaitingForDebugger'},
18-
];
19-
20-
awaitsession.send(commands);
21-
}
22-
2313
asyncfunctionrunTest(){
2414
constmain=fixtures.path('es-module-loaders','register-loader.mjs');
2515
constchild=newNodeInstance(['--inspect-wait=0'],'',main);
2616

2717
constsession=awaitchild.connectInspectorSession();
28-
awaitrunIfWaitingForDebugger(session);
18+
awaitsession.send({method: 'NodeRuntime.enable'});
19+
awaitsession.waitForNotification('NodeRuntime.waitingForDebugger');
20+
awaitsession.send([
21+
{'method': 'Runtime.enable'},
22+
{'method': 'Debugger.enable'},
23+
{'method': 'Runtime.runIfWaitingForDebugger'},
24+
]);
25+
awaitsession.send({method: 'NodeRuntime.disable'});
2926
awaitsession.waitForDisconnect();
3027
assert.strictEqual((awaitchild.expectShutdown()).exitCode,0);
3128
}

0 commit comments

Comments
(0)