inspector: send messages after the Node is done
Fixes: https://github.com/nodejs/node/issues/14432 PR-URL: https://github.com/nodejs/node/pull/14463 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
This commit is contained in:
parent
7849b52810
commit
bd65767afd
@ -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_);
|
||||
|
21
test/inspector/test-inspector-stop-profile-after-done.js
Normal file
21
test/inspector/test-inspector-stop-profile-after-done.js
Normal file
@ -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;');
|
Loading…
x
Reference in New Issue
Block a user