Tuning ABQ Performance
For most test suites, the out-of-the-box settings should be optimal. But if you're experiencing some slowness or just
want to ensure ABQ is running as quickly as possible, there are two settings to tune: --batch-size
and --test-strategy
Batch Size
ABQ introduces some network overhead by sending tests from the queue to the workers. To avoid this overhead, workers
fetch batch-size
tests at a time.
The default batch-size is 7.
If your tests are mostly slow, a lower --batch-size
may ensure a more even test distribution.
If your tests are mostly fast, a higher --batch-size
may ensure most of ABQ's network overhead is removed.
Try out a few different batch sizes to find your sweet spot, and remember: as your test suite changes, the optimal batch size may also change.
Test Strategy
ABQ has two approaches to distributing tests to workers: by-test
and by-file
.
- by-test (default): distribute the next test to any worker.
- by-file: distribute all tests in a file to the same worker.
If your test suite has some files that have expensive setup or teardown that runs only once per execution (as opposed to before or after each test), --test-strategy by-file
may result in a faster, less evenly distributed test run.
Jest and Playwright always run with a by-file strategy regardless of the value of this flag.