You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
- Allow concurrency option to accept percentage strings (e.g., "50%") in addition to absolute numbers
- Switch from os.cpus() to os.availableParallelism() for more
accurate CPU count detection
Command line: `--concurrency 4` or `--concurrency 50%`<br />
133
+
Config file: `"concurrency": 4` or `"concurrency": "50%"`
134
134
135
135
Set the concurrency of workers. This defaults to `n-1` where `n` is the number of logical CPU cores available on your machine, unless `n <= 4`, in that case it uses `n`. This is a sane default for most use cases.
136
136
137
+
You can also specify a percentage string (e.g., `"50%"`) to compute the worker count as a percentage of the available CPU cores. For example, on an 8-core machine, `"50%"` results in 4 workers. The minimum is always 1 worker.
Stryker will always run checkers and test runners in parallel by creating worker processes (note, not `worker_threads`). The number of such processes forked is determined by the configuration option [`--concurrency`](./configuration.md#concurrency-number).
6
+
Stryker will always run checkers and test runners in parallel by creating worker processes (note, not `worker_threads`). The number of such processes forked is determined by the configuration option [`--concurrency`](./configuration.md#concurrency-number--string). You can specify a number (e.g., `4`) or a percentage of CPU cores (e.g., `"50%"`).
7
7
8
8
However, imagine running these parallel processes on a test suite which uses resources like a database connection, web server or file system. This means these processes can conflict if they write to the same database, file or utilize the same port.
Copy file name to clipboardExpand all lines: packages/api/schema/stryker-core.json
+12-2Lines changed: 12 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -292,8 +292,18 @@
292
292
}
293
293
},
294
294
"concurrency": {
295
-
"description": "Set the concurrency of workers. Stryker will always run checkers and test runners in parallel by creating worker processes (note, not `worker_threads`). This defaults to `n-1` where `n` is the number of logical CPU cores available on your machine, unless `n <= 4`, in that case it uses `n`. This is a sane default for most use cases.",
296
-
"type": "number"
295
+
"description": "Set the concurrency of workers. Stryker will always run checkers and test runners in parallel by creating worker processes (note, not `worker_threads`). This defaults to `n-1` where `n` is the number of logical CPU cores available on your machine, unless `n <= 4`, in that case it uses `n`. This is a sane default for most use cases. You can also specify a percentage string (e.g., \"50%\") to compute the worker count as a percentage of the logical CPU cores available (0%-100%).",
296
+
"oneOf": [
297
+
{
298
+
"type": "number",
299
+
"minimum": 1
300
+
},
301
+
{
302
+
"type": "string",
303
+
"pattern": "^(100|[1-9]?[0-9])%$"
304
+
}
305
+
],
306
+
"examples": [4, "50%", "100%"]
297
307
},
298
308
"commandRunner": {
299
309
"description": "Options used by the command test runner. Note: these options will only be used when the command test runner is activated (this is the default)",
0 commit comments