From 982ef0097a577f01665551ecf652a6d4869c99b2 Mon Sep 17 00:00:00 2001 From: Robert Schweizer Date: Thu, 6 Apr 2023 14:46:34 +0200 Subject: [PATCH] Improve docs of maxschedchunk (#893) --- docs/distribution.rst | 3 ++- src/xdist/plugin.py | 2 ++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/docs/distribution.rst b/docs/distribution.rst index 1848ef9..93d52f6 100644 --- a/docs/distribution.rst +++ b/docs/distribution.rst @@ -50,7 +50,8 @@ The test distribution algorithm is configured with the ``--dist`` command-line o .. _distribution modes: * ``--dist load`` **(default)**: Sends pending tests to any worker that is - available, without any guaranteed order. + available, without any guaranteed order. Scheduling can be fine-tuned with + the `--maxschedchunk` option, see output of `pytest --help`. * ``--dist loadscope``: Tests are grouped by **module** for *test functions* and by **class** for *test methods*. Groups are distributed to available diff --git a/src/xdist/plugin.py b/src/xdist/plugin.py index b08b842..5360b5d 100644 --- a/src/xdist/plugin.py +++ b/src/xdist/plugin.py @@ -173,6 +173,8 @@ def pytest_addoption(parser): "one - might be useful for a small number of slow tests. " "Larger numbers will allow the scheduler to submit consecutive " "chunks of tests to workers - allows reusing fixtures. " + "Due to implementation reasons, at least 2 tests are scheduled per " + "worker at the start. Only later tests can be scheduled one by one. " "Unlimited if not set." ), )