Smarter scheduling using durations from previous runs #3438
Replies: 2 comments
|
Yes, this would be nice. There is a chunk of design work that needs to be done:
All of this is manageable and certainly worth doing -- realistically speaking though I don't quite have the time to work on this in the short or medium term. But I'd definitely encourage folks to do some prototyping and thinking about the space of possibilities here. (The first step would probably be to write a script which analyzes historical runs and spits out an estimated time taken for each test using some variant of a Kalman filter). |
|
I agree the design space is large. May I suggest a concrete first implementation on top of this experimental feature, perhaps? So CI behaviour is an important next step, but this would already make my life a lot better when testing on my laptop... |
Uh oh!
There was an error while loading. Please reload this page.
Motivation
It would be useful if nextest could optionally schedule tests in descending expected runtime order, using durations recorded from previous runs.
For test suites with a few long-running tests and many short tests, starting the longest tests first can reduce total makespan under parallel execution. This is the standard longest-processing-time-first heuristic: it helps avoid ending a run with one long test still occupying the final worker while all other workers are idle.
Proposal
nextest already records structured run data, including test outcomes and timings. A profile option or CLI flag could use historical durations from the latest comparable run to prioritise scheduling.
Add an optional scheduling mode that orders selected tests by expected duration, longest first. The expected duration could come from previous nextest run data.
For example, the interface could be a CLI flag or profile setting such as:
cargo nextest run --schedule longest-firstTests without historical timing data could fall back to the default ordering.
Alternatives
No response
Additional context
No response
All reactions