Skip to content

Commit

Permalink
inspector: send messages after the Node is done
Browse files Browse the repository at this point in the history
Fixes: #14432
PR-URL: #14463
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: James M Snell <[email protected]>
  • Loading branch information
Eugene Ostroukhov authored and addaleax committed Jul 27, 2017
1 parent 0ff19b0 commit 4836f3b
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 2 deletions.
2 changes: 0 additions & 2 deletions src/inspector_io.cc
Original file line number Diff line number Diff line change
Expand Up @@ -429,8 +429,6 @@ void InspectorIo::MainThreadReqAsyncCb(uv_async_t* req) {

void InspectorIo::Write(TransportAction action, int session_id,
const StringView& inspector_message) {
if (state_ == State::kShutDown)
return;
AppendMessage(&outgoing_message_queue_, action, session_id,
StringBuffer::create(inspector_message));
int err = uv_async_send(&thread_req_);
Expand Down
21 changes: 21 additions & 0 deletions test/inspector/test-inspector-stop-profile-after-done.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
'use strict';
const common = require('../common');
common.skipIfInspectorDisabled();
const helper = require('./inspector-helper.js');

function test(session) {
session.sendInspectorCommands([
{ 'method': 'Runtime.runIfWaitingForDebugger' },
{ 'method': 'Profiler.setSamplingInterval', 'params': { 'interval': 100 } },
{ 'method': 'Profiler.enable' },
{ 'method': 'Profiler.start' }]);
session.expectStderrOutput('Waiting for the debugger to disconnect...');
session.sendInspectorCommands({ 'method': 'Profiler.stop' });
session.disconnect(true);
}

function runTests(harness) {
harness.runFrontendSession([test]).expectShutDown(0);
}

helper.startNodeForInspectorTest(runTests, ['--inspect-brk'], 'let a = 2;');

0 comments on commit 4836f3b

Please sign in to comment.