Skip to content

Commit 630266c

Browse files
Trotttargos
authored andcommitted
debugger: indicate server is ending
Currently, we say "listening" when we are ending the server. Change it to "ending". Fixes: #39272 PR-URL: #39334 Reviewed-By: Michaël Zasso <[email protected]> Reviewed-By: Yash Ladha <[email protected]>
1 parent 4507714 commit 630266c

File tree

2 files changed

+8
-22
lines changed

2 files changed

+8
-22
lines changed

Diff for: src/inspector_socket_server.cc

+5-1
Original file line numberDiff line numberDiff line change
@@ -234,14 +234,16 @@ void PrintDebuggerReadyMessage(
234234
const std::string& host,
235235
const std::vector<InspectorSocketServer::ServerSocketPtr>& server_sockets,
236236
const std::vector<std::string>& ids,
237+
const char* verb,
237238
bool publish_uid_stderr,
238239
FILE* out) {
239240
if (!publish_uid_stderr || out == nullptr) {
240241
return;
241242
}
242243
for (const auto& server_socket : server_sockets) {
243244
for (const std::string& id : ids) {
244-
fprintf(out, "Debugger listening on %s\n",
245+
fprintf(out, "Debugger %s on %s\n",
246+
verb,
245247
FormatWsAddress(host, server_socket->port(), id, true).c_str());
246248
}
247249
}
@@ -300,6 +302,7 @@ void InspectorSocketServer::SessionTerminated(int session_id) {
300302
PrintDebuggerReadyMessage(host_,
301303
server_sockets_,
302304
delegate_->GetTargetIds(),
305+
"ending",
303306
inspect_publish_uid_.console,
304307
out_);
305308
}
@@ -425,6 +428,7 @@ bool InspectorSocketServer::Start() {
425428
PrintDebuggerReadyMessage(host_,
426429
server_sockets_,
427430
delegate_->GetTargetIds(),
431+
"listening",
428432
inspect_publish_uid_.console,
429433
out_);
430434
return true;

Diff for: test/known_issues/test-debugger-restart-message.js renamed to test/sequential/test-debugger-restart-message.js

+3-21
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,12 @@
11
'use strict';
22

3-
// Refs: https://github.com/nodejs/node/issues/39272
4-
53
const common = require('../common');
64

7-
const assert = require('assert');
8-
9-
// When this is moved out of known_issues, this skip can be removed.
10-
if (common.isOSX) {
11-
assert.fail('does not fail reliably on macOS in CI');
12-
}
5+
common.skipIfInspectorDisabled();
136

14-
// When this is moved out of known_issues, this can be removed and replaced with
15-
// the commented-out use of common.skipIfInspectorDisabled() below.
16-
if (!process.features.inspector) {
17-
assert.fail('Known issues test should fail, so if the inspector is disabled');
18-
}
19-
20-
// Will need to uncomment this when moved out of known_issues.
21-
// common.skipIfInspectorDisabled();
7+
const assert = require('assert');
228

23-
// This can be reduced to 2 or even 1 (and the loop removed) once the debugger
24-
// is fixed. It's set higher to make sure that the error is tripped reliably
25-
// in CI. On most systems, the error will be tripped on the first test, but
26-
// on a few platforms in CI, it needs to be many times.
27-
const RESTARTS = 16;
9+
const RESTARTS = 10;
2810

2911
const fixtures = require('../common/fixtures');
3012
const startCLI = require('../common/debugger');

0 commit comments

Comments
 (0)