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

Commit 016b8bd

Browse filesBrowse files
joyeecheungMoLow
authored andcommitted
test: use --port=0 in debugger tests that do not have to work on 9229
To avoid failures when there is another running process occupying the port 9229 which may happen if there is a stale process, use the --port argument of node-inspect to use a random port in tests that don't have to work on port 9229. The following tests are not touched: - test-debugger-custom-port: tests a specific port - test-debugger-debug-brk: tests a specific port - test-debugger-invalid-args: tests other inspect combinations - test-debugger-pid: node-inspect does not support -p and --port together - test-debugger-launch: tests that default port is 9229 PR-URL: #47274 Refs: #47146 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Moshe Atlow <moshe@atlow.co.il> Reviewed-By: James M Snell <jasnell@gmail.com>
1 parent 7db2e88 commit 016b8bd
Copy full SHA for 016b8bd
Expand file treeCollapse file tree

26 files changed

+26
-25
lines changed
Open diff view settings
Collapse file

‎test/sequential/test-debugger-auto-resume.mjs‎

Copy file name to clipboardExpand all lines: test/sequential/test-debugger-auto-resume.mjs
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ addLibraryPath(process.env);
2121
};
2222
env.NODE_INSPECT_RESUME_ON_START = '1';
2323

24-
const cli = startCLI([script], [], {
24+
const cli = startCLI(['--port=0', script], [], {
2525
env,
2626
});
2727

Collapse file

‎test/sequential/test-debugger-backtrace.js‎

Copy file name to clipboardExpand all lines: test/sequential/test-debugger-backtrace.js
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ const path = require('path');
1313
{
1414
const scriptFullPath = fixtures.path('debugger', 'backtrace.js');
1515
const script = path.relative(process.cwd(), scriptFullPath);
16-
const cli = startCLI([script]);
16+
const cli = startCLI(['--port=0', script]);
1717

1818
async function runTest() {
1919
try {
Collapse file

‎test/sequential/test-debugger-break.js‎

Copy file name to clipboardExpand all lines: test/sequential/test-debugger-break.js
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ const path = require('path');
1111

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

1616
(async () => {
1717
await cli.waitForInitialBreak();
Collapse file

‎test/sequential/test-debugger-breakpoint-exists.js‎

Copy file name to clipboardExpand all lines: test/sequential/test-debugger-breakpoint-exists.js
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ const startCLI = require('../common/debugger');
99

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

1414
(async () => {
1515
try {
Collapse file

‎test/sequential/test-debugger-clear-breakpoints.js‎

Copy file name to clipboardExpand all lines: test/sequential/test-debugger-clear-breakpoints.js
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ const path = require('path');
1313
{
1414
const scriptFullPath = fixtures.path('debugger', 'break.js');
1515
const script = path.relative(process.cwd(), scriptFullPath);
16-
const cli = startCLI([script]);
16+
const cli = startCLI(['--port=0', script]);
1717

1818
function onFatal(error) {
1919
cli.quit();
Collapse file

‎test/sequential/test-debugger-exceptions.js‎

Copy file name to clipboardExpand all lines: test/sequential/test-debugger-exceptions.js
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ const path = require('path');
1313
{
1414
const scriptFullPath = fixtures.path('debugger', 'exceptions.js');
1515
const script = path.relative(process.cwd(), scriptFullPath);
16-
const cli = startCLI([script]);
16+
const cli = startCLI(['--port=0', script]);
1717

1818
(async () => {
1919
try {
Collapse file

‎test/sequential/test-debugger-exec-scope.mjs‎

Copy file name to clipboardExpand all lines: test/sequential/test-debugger-exec-scope.mjs
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import startCLI from '../common/debugger.js';
77

88
import assert from 'assert';
99

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

1212
try {
1313
await cli.waitForInitialBreak();
Collapse file

‎test/sequential/test-debugger-exec.js‎

Copy file name to clipboardExpand all lines: test/sequential/test-debugger-exec.js
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ const startCLI = require('../common/debugger');
88

99
const assert = require('assert');
1010

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

1313
async function waitInitialBreak() {
1414
try {
Collapse file

‎test/sequential/test-debugger-heap-profiler.js‎

Copy file name to clipboardExpand all lines: test/sequential/test-debugger-heap-profiler.js
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ const filename = path.join(tmpdir.path, 'node.heapsnapshot');
1717
// Heap profiler take snapshot.
1818
{
1919
const opts = { cwd: tmpdir.path };
20-
const cli = startCLI([fixtures.path('debugger/empty.js')], [], opts);
20+
const cli = startCLI(['--port=0', fixtures.path('debugger/empty.js')], [], opts);
2121

2222
async function waitInitialBreak() {
2323
try {
Collapse file

‎test/sequential/test-debugger-help.mjs‎

Copy file name to clipboardExpand all lines: test/sequential/test-debugger-help.mjs
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import startCLI from '../common/debugger.js';
77

88
import assert from 'assert';
99

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

1212
try {
1313
await cli.waitForInitialBreak();

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.