From 6224372a359e241b7e465bd15be5ddc3ef789a3b Mon Sep 17 00:00:00 2001 From: Joyee Cheung Date: Wed, 5 Apr 2023 01:18:30 +0200 Subject: [PATCH 1/4] test: use random port in NodeInstance.startViaSignal() Which makes it possible to run the tests that use this in parallel. --- test/common/inspector-helper.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/common/inspector-helper.js b/test/common/inspector-helper.js index 48c9e5f1d17141..359f586344cb9e 100644 --- a/test/common/inspector-helper.js +++ b/test/common/inspector-helper.js @@ -372,7 +372,7 @@ class NodeInstance extends EventEmitter { static async startViaSignal(scriptContents) { const instance = new NodeInstance( - ['--expose-internals'], + ['--expose-internals', '--inspect-port=0'], `${scriptContents}\nprocess._rawDebug('started');`, undefined); const msg = 'Timed out waiting for process to start'; while (await fires(instance.nextStderrString(), msg, TIMEOUT) !== 'started'); From 2855bca687a3d397fa7419349776cbbcd868d53d Mon Sep 17 00:00:00 2001 From: Joyee Cheung Date: Wed, 5 Apr 2023 01:20:49 +0200 Subject: [PATCH 2/4] test: use random port in test-inspector-debug-brk-flag Which makes it possible to run it in parallel. --- test/sequential/test-inspector-debug-brk-flag.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/sequential/test-inspector-debug-brk-flag.js b/test/sequential/test-inspector-debug-brk-flag.js index db235326e96ff9..fd524b6918acd7 100644 --- a/test/sequential/test-inspector-debug-brk-flag.js +++ b/test/sequential/test-inspector-debug-brk-flag.js @@ -27,7 +27,7 @@ async function testBreakpointOnStart(session) { } async function runTests() { - const child = new NodeInstance(['--inspect', '--inspect-brk']); + const child = new NodeInstance(['--inspect-brk=0']); const session = await child.connectInspectorSession(); await testBreakpointOnStart(session); From 431ae1fc9a8a185ce6e1e1d8c0324559971f443d Mon Sep 17 00:00:00 2001 From: Joyee Cheung Date: Wed, 5 Apr 2023 01:22:47 +0200 Subject: [PATCH 3/4] test: use random port in test-inspector-enabled Which makes it possible to run it in parallel. --- test/sequential/test-inspector-enabled.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/sequential/test-inspector-enabled.js b/test/sequential/test-inspector-enabled.js index f14e7c17d817c5..33140ba5074f44 100644 --- a/test/sequential/test-inspector-enabled.js +++ b/test/sequential/test-inspector-enabled.js @@ -19,7 +19,7 @@ assert( 'inspector.isEnabled() should be false after _debugEnd()'); `; -const args = ['--inspect', '-e', script]; +const args = ['--inspect=0', '-e', script]; const child = spawn(process.execPath, args, { stdio: 'inherit', env: { ...process.env, NODE_V8_COVERAGE: '' } From db0096c1862a15dd8672444f4ba7aa56098a402a Mon Sep 17 00:00:00 2001 From: Joyee Cheung Date: Wed, 5 Apr 2023 01:24:04 +0200 Subject: [PATCH 4/4] test: move more inspector sequential tests to parallel MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This moves sequential inspector tests that can be run in parallel (using random ports) to parallel. Before: ``` ❯ tools/test.py "test/sequential/test-inspector-*" [00:07|% 100|+ 28|- 0]: Done All tests passed. ❯ tools/test.py "test/parallel/test-inspector-*" [00:01|% 100|+ 26|- 0]: Done All tests passed. ``` After: ``` ❯ tools/test.py "test/sequential/test-inspector-*" [00:00|% 100|+ 1|- 0]: Done All tests passed. ❯ tools/test.py "test/parallel/test-inspector-*" [00:01|% 100|+ 53|- 0]: Done All tests passed. ``` --- .../test-inspector-async-call-stack-abort.js | 0 test/{sequential => parallel}/test-inspector-async-call-stack.js | 0 .../test-inspector-async-hook-setup-at-inspect-brk.js | 0 .../test-inspector-async-hook-setup-at-signal.js | 0 .../test-inspector-async-stack-traces-promise-then.js | 0 .../test-inspector-async-stack-traces-set-interval.js | 0 test/{sequential => parallel}/test-inspector-break-e.js | 0 test/{sequential => parallel}/test-inspector-break-when-eval.js | 0 test/{sequential => parallel}/test-inspector-console.js | 0 test/{sequential => parallel}/test-inspector-contexts.js | 0 test/{sequential => parallel}/test-inspector-debug-brk-flag.js | 0 test/{sequential => parallel}/test-inspector-debug-end.js | 0 test/{sequential => parallel}/test-inspector-enabled.js | 0 test/{sequential => parallel}/test-inspector-exception.js | 0 .../test-inspector-has-inspector-false.js | 0 test/{sequential => parallel}/test-inspector-invalid-args.js | 0 test/{sequential => parallel}/test-inspector-ip-detection.js | 0 .../test-inspector-not-blocked-on-idle.js | 0 test/{sequential => parallel}/test-inspector-open.js | 0 test/{sequential => parallel}/test-inspector-overwrite-config.js | 0 test/{sequential => parallel}/test-inspector-port-zero.js | 0 .../test-inspector-resource-name-to-url.js | 0 .../test-inspector-runtime-evaluate-with-timeout.js | 0 .../test-inspector-scriptparsed-context.js | 0 .../test-inspector-stop-profile-after-done.js | 0 test/{sequential => parallel}/test-inspector-stops-no-file.js | 0 test/{sequential => parallel}/test-inspector-stress-http.js | 0 test/{sequential => parallel}/test-inspector.js | 0 28 files changed, 0 insertions(+), 0 deletions(-) rename test/{sequential => parallel}/test-inspector-async-call-stack-abort.js (100%) rename test/{sequential => parallel}/test-inspector-async-call-stack.js (100%) rename test/{sequential => parallel}/test-inspector-async-hook-setup-at-inspect-brk.js (100%) rename test/{sequential => parallel}/test-inspector-async-hook-setup-at-signal.js (100%) rename test/{sequential => parallel}/test-inspector-async-stack-traces-promise-then.js (100%) rename test/{sequential => parallel}/test-inspector-async-stack-traces-set-interval.js (100%) rename test/{sequential => parallel}/test-inspector-break-e.js (100%) rename test/{sequential => parallel}/test-inspector-break-when-eval.js (100%) rename test/{sequential => parallel}/test-inspector-console.js (100%) rename test/{sequential => parallel}/test-inspector-contexts.js (100%) rename test/{sequential => parallel}/test-inspector-debug-brk-flag.js (100%) rename test/{sequential => parallel}/test-inspector-debug-end.js (100%) rename test/{sequential => parallel}/test-inspector-enabled.js (100%) rename test/{sequential => parallel}/test-inspector-exception.js (100%) rename test/{sequential => parallel}/test-inspector-has-inspector-false.js (100%) rename test/{sequential => parallel}/test-inspector-invalid-args.js (100%) rename test/{sequential => parallel}/test-inspector-ip-detection.js (100%) rename test/{sequential => parallel}/test-inspector-not-blocked-on-idle.js (100%) rename test/{sequential => parallel}/test-inspector-open.js (100%) rename test/{sequential => parallel}/test-inspector-overwrite-config.js (100%) rename test/{sequential => parallel}/test-inspector-port-zero.js (100%) rename test/{sequential => parallel}/test-inspector-resource-name-to-url.js (100%) rename test/{sequential => parallel}/test-inspector-runtime-evaluate-with-timeout.js (100%) rename test/{sequential => parallel}/test-inspector-scriptparsed-context.js (100%) rename test/{sequential => parallel}/test-inspector-stop-profile-after-done.js (100%) rename test/{sequential => parallel}/test-inspector-stops-no-file.js (100%) rename test/{sequential => parallel}/test-inspector-stress-http.js (100%) rename test/{sequential => parallel}/test-inspector.js (100%) diff --git a/test/sequential/test-inspector-async-call-stack-abort.js b/test/parallel/test-inspector-async-call-stack-abort.js similarity index 100% rename from test/sequential/test-inspector-async-call-stack-abort.js rename to test/parallel/test-inspector-async-call-stack-abort.js diff --git a/test/sequential/test-inspector-async-call-stack.js b/test/parallel/test-inspector-async-call-stack.js similarity index 100% rename from test/sequential/test-inspector-async-call-stack.js rename to test/parallel/test-inspector-async-call-stack.js diff --git a/test/sequential/test-inspector-async-hook-setup-at-inspect-brk.js b/test/parallel/test-inspector-async-hook-setup-at-inspect-brk.js similarity index 100% rename from test/sequential/test-inspector-async-hook-setup-at-inspect-brk.js rename to test/parallel/test-inspector-async-hook-setup-at-inspect-brk.js diff --git a/test/sequential/test-inspector-async-hook-setup-at-signal.js b/test/parallel/test-inspector-async-hook-setup-at-signal.js similarity index 100% rename from test/sequential/test-inspector-async-hook-setup-at-signal.js rename to test/parallel/test-inspector-async-hook-setup-at-signal.js diff --git a/test/sequential/test-inspector-async-stack-traces-promise-then.js b/test/parallel/test-inspector-async-stack-traces-promise-then.js similarity index 100% rename from test/sequential/test-inspector-async-stack-traces-promise-then.js rename to test/parallel/test-inspector-async-stack-traces-promise-then.js diff --git a/test/sequential/test-inspector-async-stack-traces-set-interval.js b/test/parallel/test-inspector-async-stack-traces-set-interval.js similarity index 100% rename from test/sequential/test-inspector-async-stack-traces-set-interval.js rename to test/parallel/test-inspector-async-stack-traces-set-interval.js diff --git a/test/sequential/test-inspector-break-e.js b/test/parallel/test-inspector-break-e.js similarity index 100% rename from test/sequential/test-inspector-break-e.js rename to test/parallel/test-inspector-break-e.js diff --git a/test/sequential/test-inspector-break-when-eval.js b/test/parallel/test-inspector-break-when-eval.js similarity index 100% rename from test/sequential/test-inspector-break-when-eval.js rename to test/parallel/test-inspector-break-when-eval.js diff --git a/test/sequential/test-inspector-console.js b/test/parallel/test-inspector-console.js similarity index 100% rename from test/sequential/test-inspector-console.js rename to test/parallel/test-inspector-console.js diff --git a/test/sequential/test-inspector-contexts.js b/test/parallel/test-inspector-contexts.js similarity index 100% rename from test/sequential/test-inspector-contexts.js rename to test/parallel/test-inspector-contexts.js diff --git a/test/sequential/test-inspector-debug-brk-flag.js b/test/parallel/test-inspector-debug-brk-flag.js similarity index 100% rename from test/sequential/test-inspector-debug-brk-flag.js rename to test/parallel/test-inspector-debug-brk-flag.js diff --git a/test/sequential/test-inspector-debug-end.js b/test/parallel/test-inspector-debug-end.js similarity index 100% rename from test/sequential/test-inspector-debug-end.js rename to test/parallel/test-inspector-debug-end.js diff --git a/test/sequential/test-inspector-enabled.js b/test/parallel/test-inspector-enabled.js similarity index 100% rename from test/sequential/test-inspector-enabled.js rename to test/parallel/test-inspector-enabled.js diff --git a/test/sequential/test-inspector-exception.js b/test/parallel/test-inspector-exception.js similarity index 100% rename from test/sequential/test-inspector-exception.js rename to test/parallel/test-inspector-exception.js diff --git a/test/sequential/test-inspector-has-inspector-false.js b/test/parallel/test-inspector-has-inspector-false.js similarity index 100% rename from test/sequential/test-inspector-has-inspector-false.js rename to test/parallel/test-inspector-has-inspector-false.js diff --git a/test/sequential/test-inspector-invalid-args.js b/test/parallel/test-inspector-invalid-args.js similarity index 100% rename from test/sequential/test-inspector-invalid-args.js rename to test/parallel/test-inspector-invalid-args.js diff --git a/test/sequential/test-inspector-ip-detection.js b/test/parallel/test-inspector-ip-detection.js similarity index 100% rename from test/sequential/test-inspector-ip-detection.js rename to test/parallel/test-inspector-ip-detection.js diff --git a/test/sequential/test-inspector-not-blocked-on-idle.js b/test/parallel/test-inspector-not-blocked-on-idle.js similarity index 100% rename from test/sequential/test-inspector-not-blocked-on-idle.js rename to test/parallel/test-inspector-not-blocked-on-idle.js diff --git a/test/sequential/test-inspector-open.js b/test/parallel/test-inspector-open.js similarity index 100% rename from test/sequential/test-inspector-open.js rename to test/parallel/test-inspector-open.js diff --git a/test/sequential/test-inspector-overwrite-config.js b/test/parallel/test-inspector-overwrite-config.js similarity index 100% rename from test/sequential/test-inspector-overwrite-config.js rename to test/parallel/test-inspector-overwrite-config.js diff --git a/test/sequential/test-inspector-port-zero.js b/test/parallel/test-inspector-port-zero.js similarity index 100% rename from test/sequential/test-inspector-port-zero.js rename to test/parallel/test-inspector-port-zero.js diff --git a/test/sequential/test-inspector-resource-name-to-url.js b/test/parallel/test-inspector-resource-name-to-url.js similarity index 100% rename from test/sequential/test-inspector-resource-name-to-url.js rename to test/parallel/test-inspector-resource-name-to-url.js diff --git a/test/sequential/test-inspector-runtime-evaluate-with-timeout.js b/test/parallel/test-inspector-runtime-evaluate-with-timeout.js similarity index 100% rename from test/sequential/test-inspector-runtime-evaluate-with-timeout.js rename to test/parallel/test-inspector-runtime-evaluate-with-timeout.js diff --git a/test/sequential/test-inspector-scriptparsed-context.js b/test/parallel/test-inspector-scriptparsed-context.js similarity index 100% rename from test/sequential/test-inspector-scriptparsed-context.js rename to test/parallel/test-inspector-scriptparsed-context.js diff --git a/test/sequential/test-inspector-stop-profile-after-done.js b/test/parallel/test-inspector-stop-profile-after-done.js similarity index 100% rename from test/sequential/test-inspector-stop-profile-after-done.js rename to test/parallel/test-inspector-stop-profile-after-done.js diff --git a/test/sequential/test-inspector-stops-no-file.js b/test/parallel/test-inspector-stops-no-file.js similarity index 100% rename from test/sequential/test-inspector-stops-no-file.js rename to test/parallel/test-inspector-stops-no-file.js diff --git a/test/sequential/test-inspector-stress-http.js b/test/parallel/test-inspector-stress-http.js similarity index 100% rename from test/sequential/test-inspector-stress-http.js rename to test/parallel/test-inspector-stress-http.js diff --git a/test/sequential/test-inspector.js b/test/parallel/test-inspector.js similarity index 100% rename from test/sequential/test-inspector.js rename to test/parallel/test-inspector.js