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: various fixes to the debugger and the debugger tests #44359

Merged
merged 3 commits into from Aug 24, 2022
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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
7 changes: 5 additions & 2 deletions lib/internal/debugger/inspect.js
Expand Up @@ -45,7 +45,7 @@ const debuglog = util.debuglog('inspect');

const { ERR_DEBUGGER_STARTUP_ERROR } = require('internal/errors').codes;

async function portIsFree(host, port, timeout = 9999) {
async function portIsFree(host, port, timeout = 3000) {
if (port === 0) return; // Binding to a random port.

const retryDelay = 150;
Expand All @@ -64,7 +64,10 @@ async function portIsFree(host, port, timeout = 9999) {
const error = await new Promise((resolve) => {
const socket = net.connect(port, host);
socket.on('error', resolve);
socket.on('connect', resolve);
socket.on('connect', () => {
socket.end();
resolve();
});
});
if (error?.code === 'ECONNREFUSED') {
return;
Expand Down
8 changes: 7 additions & 1 deletion test/common/debugger.js
Expand Up @@ -7,7 +7,13 @@ const BREAK_MESSAGE = new RegExp('(?:' + [
'exception', 'other', 'promiseRejection',
].join('|') + ') in', 'i');

const TIMEOUT = common.platformTimeout(5000);
let TIMEOUT = common.platformTimeout(5000);
if (common.isWindows) {
// Some of the windows machines in the CI need more time to receive
// the outputs from the client.
// https://github.com/nodejs/build/issues/3014
TIMEOUT = common.platformTimeout(15000);
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am not sure if there is a more specific way to test that we are on the azure win10 vs2019 machines, but I believe a longer timeout isn't going to be a problem for Windows machines anyway, so it's probably ok to just increase the timeout for all Windows machines (if they really take too long they are going to be terminated by the test runner anyway)

}

function isPreBreak(output) {
return /Break on start/.test(output) && /1 \(function \(exports/.test(output);
Expand Down