Skip to content

Commit 4836f3b

Browse files
Eugene Ostroukhovaddaleax
Eugene Ostroukhov
authored andcommitted
inspector: send messages after the Node is done
Fixes: #14432 PR-URL: #14463 Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: James M Snell <[email protected]>
1 parent 0ff19b0 commit 4836f3b

File tree

2 files changed

+21
-2
lines changed

2 files changed

+21
-2
lines changed

src/inspector_io.cc

-2
Original file line numberDiff line numberDiff line change
@@ -429,8 +429,6 @@ void InspectorIo::MainThreadReqAsyncCb(uv_async_t* req) {
429429

430430
void InspectorIo::Write(TransportAction action, int session_id,
431431
const StringView& inspector_message) {
432-
if (state_ == State::kShutDown)
433-
return;
434432
AppendMessage(&outgoing_message_queue_, action, session_id,
435433
StringBuffer::create(inspector_message));
436434
int err = uv_async_send(&thread_req_);
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
'use strict';
2+
const common = require('../common');
3+
common.skipIfInspectorDisabled();
4+
const helper = require('./inspector-helper.js');
5+
6+
function test(session) {
7+
session.sendInspectorCommands([
8+
{ 'method': 'Runtime.runIfWaitingForDebugger' },
9+
{ 'method': 'Profiler.setSamplingInterval', 'params': { 'interval': 100 } },
10+
{ 'method': 'Profiler.enable' },
11+
{ 'method': 'Profiler.start' }]);
12+
session.expectStderrOutput('Waiting for the debugger to disconnect...');
13+
session.sendInspectorCommands({ 'method': 'Profiler.stop' });
14+
session.disconnect(true);
15+
}
16+
17+
function runTests(harness) {
18+
harness.runFrontendSession([test]).expectShutDown(0);
19+
}
20+
21+
helper.startNodeForInspectorTest(runTests, ['--inspect-brk'], 'let a = 2;');

0 commit comments

Comments
 (0)