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

test: use --port=0 in most sequential debugger tests and move them to parallel #47274

Closed
wants to merge 2 commits into from
Closed
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
Expand Up @@ -21,7 +21,7 @@ addLibraryPath(process.env);
};
env.NODE_INSPECT_RESUME_ON_START = '1';

const cli = startCLI([script], [], {
const cli = startCLI(['--port=0', script], [], {
env,
});

Expand Down
Expand Up @@ -13,7 +13,7 @@ const path = require('path');
{
const scriptFullPath = fixtures.path('debugger', 'backtrace.js');
const script = path.relative(process.cwd(), scriptFullPath);
const cli = startCLI([script]);
const cli = startCLI(['--port=0', script]);

async function runTest() {
try {
Expand Down
Expand Up @@ -11,7 +11,7 @@ const path = require('path');

const scriptFullPath = fixtures.path('debugger', 'break.js');
const script = path.relative(process.cwd(), scriptFullPath);
const cli = startCLI([script]);
const cli = startCLI(['--port=0', script]);

(async () => {
await cli.waitForInitialBreak();
Expand Down
Expand Up @@ -9,7 +9,7 @@ const startCLI = require('../common/debugger');

// Test for "Breakpoint at specified location already exists" error.
const script = fixtures.path('debugger', 'three-lines.js');
const cli = startCLI([script]);
const cli = startCLI(['--port=0', script]);

(async () => {
try {
Expand Down
Expand Up @@ -13,7 +13,7 @@ const path = require('path');
{
const scriptFullPath = fixtures.path('debugger', 'break.js');
const script = path.relative(process.cwd(), scriptFullPath);
const cli = startCLI([script]);
const cli = startCLI(['--port=0', script]);

function onFatal(error) {
cli.quit();
Expand Down
Expand Up @@ -13,7 +13,7 @@ const path = require('path');
{
const scriptFullPath = fixtures.path('debugger', 'exceptions.js');
const script = path.relative(process.cwd(), scriptFullPath);
const cli = startCLI([script]);
const cli = startCLI(['--port=0', script]);

(async () => {
try {
Expand Down
Expand Up @@ -7,7 +7,7 @@ import startCLI from '../common/debugger.js';

import assert from 'assert';

const cli = startCLI([path('debugger/backtrace.js')]);
const cli = startCLI(['--port=0', path('debugger/backtrace.js')]);

try {
await cli.waitForInitialBreak();
Expand Down
Expand Up @@ -8,7 +8,7 @@ const startCLI = require('../common/debugger');

const assert = require('assert');

const cli = startCLI([fixtures.path('debugger/alive.js')]);
const cli = startCLI(['--port=0', fixtures.path('debugger/alive.js')]);

async function waitInitialBreak() {
try {
Expand Down
Expand Up @@ -17,7 +17,7 @@ const filename = path.join(tmpdir.path, 'node.heapsnapshot');
// Heap profiler take snapshot.
{
const opts = { cwd: tmpdir.path };
const cli = startCLI([fixtures.path('debugger/empty.js')], [], opts);
const cli = startCLI(['--port=0', fixtures.path('debugger/empty.js')], [], opts);

async function waitInitialBreak() {
try {
Expand Down
Expand Up @@ -7,7 +7,7 @@ import startCLI from '../common/debugger.js';

import assert from 'assert';

const cli = startCLI([path('debugger', 'empty.js')]);
const cli = startCLI(['--port=0', path('debugger', 'empty.js')]);

try {
await cli.waitForInitialBreak();
Expand Down
Expand Up @@ -8,7 +8,7 @@ const startCLI = require('../common/debugger');

const assert = require('assert');

const cli = startCLI([fixtures.path('debugger/three-lines.js')]);
const cli = startCLI(['--port=0', fixtures.path('debugger/three-lines.js')]);

(async () => {
await cli.waitForInitialBreak();
Expand Down
Expand Up @@ -9,7 +9,7 @@ const assert = require('assert');

// Debugger agent direct access.
{
const cli = startCLI([fixtures.path('debugger/three-lines.js')]);
const cli = startCLI(['--port=0', fixtures.path('debugger/three-lines.js')]);
const scriptPattern = /^\* (\d+): \S+debugger(?:\/|\\)three-lines\.js/m;

async function testDebuggerLowLevel() {
Expand Down
Expand Up @@ -8,7 +8,7 @@ const startCLI = require('../common/debugger');

const assert = require('assert');

const cli = startCLI([fixtures.path('debugger/empty.js')]);
const cli = startCLI(['--port=0', fixtures.path('debugger/empty.js')]);

(async () => {
await cli.waitForInitialBreak();
Expand Down
Expand Up @@ -14,7 +14,7 @@ const script = path.relative(process.cwd(), scriptFullPath);

// Run after quit.
const runTest = async () => {
const cli = startCLI([script]);
const cli = startCLI(['--port=0', script]);
try {
await cli.waitForInitialBreak();
await cli.waitForPrompt();
Expand Down
Expand Up @@ -10,7 +10,7 @@ const assert = require('assert');
const fs = require('fs');
const path = require('path');

const cli = startCLI([fixtures.path('debugger/empty.js')]);
const cli = startCLI(['--port=0', fixtures.path('debugger/empty.js')]);

const rootDir = path.resolve(__dirname, '..', '..');

Expand Down
Expand Up @@ -14,7 +14,7 @@ function delay(ms) {

// Profiles.
{
const cli = startCLI([fixtures.path('debugger/empty.js')]);
const cli = startCLI(['--port=0', fixtures.path('debugger/empty.js')]);

function onFatal(error) {
cli.quit();
Expand Down
Expand Up @@ -8,7 +8,7 @@ const fixture = path('debugger-repeat-last.js');

const args = [
'inspect',
`--port=${common.PORT}`,
'--port=0',
fixture,
];

Expand Down
Expand Up @@ -14,7 +14,7 @@ const startCLI = require('../common/debugger');
// Using `restart` should result in only one "Connect/For help" message.
{
const script = fixtures.path('debugger', 'three-lines.js');
const cli = startCLI([script]);
const cli = startCLI(['--port=0', script]);

const listeningRegExp = /Debugger listening on/g;

Expand Down
Expand Up @@ -13,7 +13,7 @@ const path = require('path');
{
const scriptFullPath = fixtures.path('debugger', 'three-lines.js');
const script = path.relative(process.cwd(), scriptFullPath);
const cli = startCLI([script]);
const cli = startCLI(['--port=0', script]);

function onFatal(error) {
cli.quit();
Expand Down
Expand Up @@ -17,7 +17,7 @@ const script = path.relative(process.cwd(), scriptFullPath);
const otherScriptFullPath = fixtures.path('debugger', 'cjs', 'other.js');
const otherScript = path.relative(process.cwd(), otherScriptFullPath);

const cli = startCLI([script]);
const cli = startCLI(['--port=0', script]);

(async () => {
await cli.waitForInitialBreak();
Expand Down
Expand Up @@ -11,7 +11,7 @@ const assert = require('assert');
// List scripts.
{
const script = fixtures.path('debugger', 'three-lines.js');
const cli = startCLI([script]);
const cli = startCLI(['--port=0', script]);

(async () => {
try {
Expand Down
Expand Up @@ -7,7 +7,7 @@ import startCLI from '../common/debugger.js';
import assert from 'assert';

const script = path('debugger', 'twenty-lines.js');
const cli = startCLI([script]);
const cli = startCLI(['--port=0', script]);

function onFatal(error) {
cli.quit();
Expand Down
Expand Up @@ -11,7 +11,7 @@ const assert = require('assert');
// Test for files that start with strict directive.
{
const script = fixtures.path('debugger', 'use-strict.js');
const cli = startCLI([script]);
const cli = startCLI(['--port=0', script]);

function onFatal(error) {
cli.quit();
Expand Down
Expand Up @@ -8,7 +8,7 @@ const startCLI = require('../common/debugger');

const assert = require('assert');

const cli = startCLI([fixtures.path('debugger/break.js')]);
const cli = startCLI(['--port=0', fixtures.path('debugger/break.js')]);

(async () => {
await cli.waitForInitialBreak();
Expand Down
Expand Up @@ -7,7 +7,7 @@ import startCLI from '../common/debugger.js';
import assert from 'assert';

const script = path('debugger', 'break.js');
const cli = startCLI([script]);
const cli = startCLI(['--port=0', script]);

function onFatal(error) {
cli.quit();
Expand Down
1 change: 1 addition & 0 deletions test/sequential/test-debugger-launch.mjs
@@ -1,6 +1,7 @@
import { skipIfInspectorDisabled } from '../common/index.mjs';
skipIfInspectorDisabled();

// This must be in sequential because we check that the default port is 9229.
import { path } from '../common/fixtures.mjs';
import startCLI from '../common/debugger.js';

Expand Down