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
{{ message }}
Repository navigation
Adaptive parallelism: adjust the parallel test limit from machine load and throughput #7871
The number of tests that run at once is a fixed number: 2 x the processor count, or whatever --maximum-parallel-tests sets. That is too low for suites of asynchronous I/O-bound tests, which leave the machine mostly idle, and too high for suites whose tests use a lot of memory or CPU. Users have to find a good number by trial and error for each suite and each machine.
Proposal
Add an opt-in adaptive mode that changes the limit while the run is in progress:
Raise the limit step by step while tests are waiting for a slot, the machine has CPU and memory headroom, and the previous raise increased the rate at which tests complete.
Stop raising once a raise brings no more throughput. This covers suites limited by something outside the process, such as a database connection pool, where idle CPU does not mean more tests would help.
Lower the limit when memory is under pressure, or when the CPUs are saturated and work is queuing for a thread.
Treat an explicit --maximum-parallel-tests (or its environment variable and settings equivalents) as a hard upper bound.
Log each change of the limit so a run can be understood afterwards.
Enable it with a command-line flag, an environment variable or TUnitSettings. The fixed limit stays the default until benchmarks across CPU-bound, asynchronous I/O, blocking I/O and memory-heavy suites show the adaptive mode is at least as fast everywhere.
Background
An earlier adaptive controller (#2792) was removed in #2825 two days after it was added. This proposal differs in using throughput feedback as the signal for raising the limit, with machine metrics only as guards.
Activity
feat(engine): opt-in adaptive parallelism driven by machine load and …