-
Notifications
You must be signed in to change notification settings - Fork 240
Description
Reading this blog post about Stripe's test runner made me think we should have a --slow-first
option for xdist, and it seems that we don't yet 😅 The motivation for --slow-first
is that fastest-tests-last is a great heuristic to reduce the duration at the end of a test run when some processes are done but others are still running - which can range from negligible to "several times longer than the rest of the run" (when e.g. I select mostly fast unit tests, plus a few slow integration tests which happen to run last).
IMO this should be lower priority than --last-failed
, only reorder passing tests for --failed-first
, and be incompatible with --new-first
(existing flag docs). The main trick is to cache durations from the last run, and then order by the aggregate time for each loadscope (i.e. method, class, or file, depending on what we'll distribute - pytest-randomly is useful prior art).