From 3e524374e10d065d92ce2038b405b5799d501355 Mon Sep 17 00:00:00 2001 From: Sergey Chernyshev Date: Thu, 25 Apr 2024 04:22:17 +0200 Subject: [PATCH] test_runner, cli: add --test-concurrency flag This commit adds a new --test-concurrency CLI flag that controls the parallelism of the test runner CLI. PR-URL: https://github.com/nodejs/node/pull/49996 Fixes: https://github.com/nodejs/node/issues/49487 Reviewed-By: Matteo Collina Reviewed-By: Moshe Atlow Reviewed-By: Benjamin Gruenbaum Reviewed-By: Chemi Atlow --- graal-nodejs/doc/api/cli.md | 9 ++++ graal-nodejs/doc/api/test.md | 12 ++--- graal-nodejs/doc/node.1 | 4 ++ graal-nodejs/lib/internal/main/test_runner.js | 2 +- graal-nodejs/src/node_options.cc | 3 ++ graal-nodejs/src/node_options.h | 1 + .../parallel/test-runner-cli-concurrency.js | 45 +++++++++++++++++++ 7 files changed, 70 insertions(+), 6 deletions(-) create mode 100644 graal-nodejs/test/parallel/test-runner-cli-concurrency.js diff --git a/graal-nodejs/doc/api/cli.md b/graal-nodejs/doc/api/cli.md index 83d9c5182e1..a0d3cbcd8ef 100644 --- a/graal-nodejs/doc/api/cli.md +++ b/graal-nodejs/doc/api/cli.md @@ -1298,6 +1298,15 @@ Starts the Node.js command line test runner. This flag cannot be combined with See the documentation on [running tests from the command line][] for more details. +### `--test-concurrency` + + + +The maximum number of test files that the test runner CLI will execute +concurrently. The default value is `os.availableParallelism() - 1`. + ### `--test-name-pattern`