Scheduling
Baseline-Driven Selection
When a job starts, DAGZ loads the baseline and compares code fingerprints against the current state. Only tests that depend on changed code are selected. The selected tests are then scheduled across workers based on their historical durations — balancing the load so all workers finish around the same time.
New tests without history get a default time estimate.
Fixture-Aware Grouping
Test fixtures have setup costs. DAGZ groups tests that share fixtures on the same worker to avoid redundant setup:
- Tests in the same class stay "attracted" together (class-scoped fixtures set up once)
- Tests in the same module stay "attracted" together (module-scoped fixtures set up once)
This reduces total execution time when fixtures are expensive.
Work Stealing
Plans don't always match reality — some tests run faster or slower than expected. When a worker finishes early, it steals remaining work from the busiest worker. This keeps all workers productive until the end.
Worker Recycling
On Linux, workers run in fork mode — each worker is an isolated process. If a worker's memory usage exceeds a configured threshold, it's automatically restarted between tests.
This prevents memory leaks in test code from degrading the entire session.