Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

debugger: do not repeat connection message when disconnecting #39334

Merged
merged 1 commit into from
Jul 12, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion src/inspector_socket_server.cc
Original file line number Diff line number Diff line change
Expand Up @@ -234,14 +234,16 @@ void PrintDebuggerReadyMessage(
const std::string& host,
const std::vector<InspectorSocketServer::ServerSocketPtr>& server_sockets,
const std::vector<std::string>& ids,
const char* verb,
bool publish_uid_stderr,
FILE* out) {
if (!publish_uid_stderr || out == nullptr) {
return;
}
for (const auto& server_socket : server_sockets) {
for (const std::string& id : ids) {
fprintf(out, "Debugger listening on %s\n",
fprintf(out, "Debugger %s on %s\n",
verb,
FormatWsAddress(host, server_socket->port(), id, true).c_str());
}
}
Expand Down Expand Up @@ -300,6 +302,7 @@ void InspectorSocketServer::SessionTerminated(int session_id) {
PrintDebuggerReadyMessage(host_,
server_sockets_,
delegate_->GetTargetIds(),
"ending",
inspect_publish_uid_.console,
out_);
}
Expand Down Expand Up @@ -425,6 +428,7 @@ bool InspectorSocketServer::Start() {
PrintDebuggerReadyMessage(host_,
server_sockets_,
delegate_->GetTargetIds(),
"listening",
inspect_publish_uid_.console,
out_);
return true;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,30 +1,12 @@
'use strict';

// Refs: https://github.com/nodejs/node/issues/39272

const common = require('../common');

const assert = require('assert');

// When this is moved out of known_issues, this skip can be removed.
if (common.isOSX) {
assert.fail('does not fail reliably on macOS in CI');
}
common.skipIfInspectorDisabled();

// When this is moved out of known_issues, this can be removed and replaced with
// the commented-out use of common.skipIfInspectorDisabled() below.
if (!process.features.inspector) {
assert.fail('Known issues test should fail, so if the inspector is disabled');
}

// Will need to uncomment this when moved out of known_issues.
// common.skipIfInspectorDisabled();
const assert = require('assert');

// This can be reduced to 2 or even 1 (and the loop removed) once the debugger
// is fixed. It's set higher to make sure that the error is tripped reliably
// in CI. On most systems, the error will be tripped on the first test, but
// on a few platforms in CI, it needs to be many times.
const RESTARTS = 16;
const RESTARTS = 10;
yashLadha marked this conversation as resolved.
Show resolved Hide resolved

const fixtures = require('../common/fixtures');
const startCLI = require('../common/debugger');
Expand Down