Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 7819bfe

Browse filesBrowse files
lpincaaduh95
authored andcommitted
test: deflake test-esm-loader-hooks-inspect-brk
Refs: #54827 Refs: #51560 PR-URL: #56050 Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
1 parent e9762bf commit 7819bfe
Copy full SHA for 7819bfe

File tree

Expand file treeCollapse file tree

1 file changed

+9
-12
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

1 file changed

+9
-12
lines changed
Open diff view settings
Collapse file

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

Copy file name to clipboardExpand all lines: test/parallel/test-esm-loader-hooks-inspect-brk.js
+9-12Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -10,23 +10,20 @@ const assert = require('assert');
1010
const fixtures = require('../common/fixtures');
1111
const { NodeInstance } = require('../common/inspector-helper.js');
1212

13-
async function runIfWaitingForDebugger(session) {
14-
const commands = [
15-
{ 'method': 'Runtime.enable' },
16-
{ 'method': 'Debugger.enable' },
17-
{ 'method': 'Runtime.runIfWaitingForDebugger' },
18-
];
19-
20-
await session.send(commands);
21-
await session.waitForNotification('Debugger.paused');
22-
}
23-
2413
async function runTest() {
2514
const main = fixtures.path('es-module-loaders', 'register-loader.mjs');
2615
const child = new NodeInstance(['--inspect-brk=0'], '', main);
2716

2817
const session = await child.connectInspectorSession();
29-
await runIfWaitingForDebugger(session);
18+
await session.send({ method: 'NodeRuntime.enable' });
19+
await session.waitForNotification('NodeRuntime.waitingForDebugger');
20+
await session.send([
21+
{ 'method': 'Runtime.enable' },
22+
{ 'method': 'Debugger.enable' },
23+
{ 'method': 'Runtime.runIfWaitingForDebugger' },
24+
]);
25+
await session.send({ method: 'NodeRuntime.disable' });
26+
await session.waitForNotification('Debugger.paused');
3027
await session.runToCompletion();
3128
assert.strictEqual((await child.expectShutdown()).exitCode, 0);
3229
}

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.