LoadScope scheduler: Sort scopes by number of tests to assign biggest scopes first #778
 Add this suggestion to a batch that can be applied as a single commit. This suggestion is invalid because no changes were made to the code. Suggestions cannot be applied while the pull request is closed. Suggestions cannot be applied while viewing a subset of changes. Only one suggestion per line can be applied in a batch. Add this suggestion to a batch that can be applied as a single commit. Applying suggestions on deleted lines is not supported. You must change the existing code in this line in order to create a valid suggestion. Outdated suggestions cannot be applied. This suggestion has been applied or marked resolved. Suggestions cannot be applied from pending reviews. Suggestions cannot be applied on multi-line comments. Suggestions cannot be applied while the pull request is queued to merge. Suggestion cannot be applied right now. Please check back later.    
 
Based upon this PR/branch, OP text quoted here:
I have one reservation about this change and backwards compatibility when we have
test_a.pyandtest_b.py:test_b.pyis run before any tests fromtest_a.pyin any runnertest_b.pymight run before any tests fromtest_a.pyin a runner (iftest_b.pycontains more tests)I don't know what the general
pytest(-plugin)'s view andpytest-xdist's view in particular is on backwards compatibility in the face of, essentially, flaky/broken tests.Long term I wonder whether we would want to expose the ordering of this queue somehow: it would be cool when e.g. running in CircleCI (which can seed based on previous running times) to be able to repeat the same within the runners, especially as they could have many cores/parallel runners and so there can be inefficiencies.