Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings
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
7 changes: 5 additions & 2 deletions 7 lib/internal/debugger/inspect.js
Original file line number Diff line number Diff line change
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 8 test/common/debugger.js
Original file line number Diff line number Diff line change
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

@joyeecheung joyeecheung Aug 24, 2022

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
Morty Proxy This is a proxified and sanitized view of the page, visit original site.