Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Contributing isoscope scheduler #1126

Open
wants to merge 52 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
52 commits
Select commit Hold shift + click to select a range
124ffc0
Introducing contributed code for isoscope scheduling.
Sep 6, 2024
ed63fe4
Integrate isoscope scheduling and distributed sccope isolation into x…
Sep 6, 2024
329f218
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Sep 6, 2024
17ad842
Addressed pre-commit findings.
Sep 9, 2024
be0a561
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Sep 9, 2024
3689139
Addressed additional pre-commit findings.
Sep 9, 2024
2671eec
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Sep 9, 2024
879ff2c
Addressed additional pre-commit findings.
Sep 9, 2024
94ae58c
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Sep 9, 2024
20caaeb
Addressed additional pre-coimmit finding.
Sep 9, 2024
77b4157
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Sep 9, 2024
4486a9f
Addressed pre-coimmit finding.
Sep 9, 2024
1b9f92d
Add isoscope parametrization to generic acceptance tests test_single_…
Oct 22, 2024
c5d49b1
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Oct 22, 2024
9597f6f
Use List and Tuple from typing when specifying these types with subsc…
Oct 22, 2024
359938d
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Oct 22, 2024
7a29564
Address pre-commit findings concerning the use of tuple vs Tuple and …
Oct 22, 2024
017c1f6
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Oct 22, 2024
d8d97a1
Implemented acceptance test class TestIsoScope baesd on TestLoadScope.
Oct 23, 2024
95a16a6
Fix expected counts in TestIsoScope test_by_module, test_by_class, an…
Oct 23, 2024
61f5fad
Implemented acceptance test TestIsoScope.test_single_scope_all_worker…
Oct 23, 2024
edc3bd3
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Oct 23, 2024
db311ed
Implemented acceptance test TestIsoScope.test_single_scope_subset_of_…
Oct 23, 2024
6bb3ef2
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Oct 23, 2024
7f35d75
Fixed worker name key error for unutilized worker in acceptance test …
Oct 23, 2024
eebc3f4
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Oct 23, 2024
4695e43
Fixed default test counts in acceptance test TestIsoScope.test_single…
Oct 23, 2024
a4398b2
Removed extraneous setdefault in acceptance test TestIsoScope.test_si…
Oct 23, 2024
47fcf7a
Implemented acceptance test TestIsoScope.test_multi_scope_with_insuff…
Oct 24, 2024
680d855
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Oct 24, 2024
d2bff97
Fixed test discoverability and pre-commit findings in acceptance test…
Oct 24, 2024
0e00ed9
Fixed TestFenceA/B search patterin in acceptance test TestIsoScope.te…
Oct 24, 2024
fa97762
Fix test_fence_scopes pytest filename in acceptance test TestIsoScope…
Oct 24, 2024
3b7f2de
Implemented acceptance test TestIsoScope.test_two_tests_min_per_worke…
Oct 24, 2024
da65e86
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Oct 24, 2024
ad0f4af
Work in progress on acceptance test TestIsoScope.test_distributed_set…
Oct 25, 2024
4658a1c
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Oct 25, 2024
97fe2e6
Work in progress on acceptance test TestIsoScope.test_distributed_set…
Oct 25, 2024
6aa321d
Work in progress on acceptance test TestIsoScope.test_distributed_set…
Oct 25, 2024
d110668
Work in progress on acceptance test TestIsoScope.test_distributed_set…
Oct 25, 2024
46f33a6
Work in progress on acceptance test TestIsoScope.test_distributed_set…
Oct 25, 2024
4711108
Work in progress on acceptance test TestIsoScope.test_distributed_set…
Oct 25, 2024
5f988d9
Work in progress on acceptance test TestIsoScope.test_distributed_set…
Oct 25, 2024
c649eb5
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Oct 25, 2024
b865e9d
Work in progress on acceptance test TestIsoScope.test_distributed_set…
Oct 25, 2024
4292294
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Oct 25, 2024
f1bf9aa
Work in progress on acceptance test TestIsoScope.test_distributed_set…
Oct 25, 2024
b71c911
Removed whitespace from blank lines.
Oct 25, 2024
06fe668
Initialize the status file used by underlying test in TestIsoScope.te…
Oct 25, 2024
b1f032d
Create parent directories for the status file used by underlying test…
Oct 25, 2024
52c0815
Fixed SyntaxError: (unicode error) 'unicodeescape' codec can't decode…
Oct 25, 2024
95b91c8
Fix node_path.relative_to(...) in _DistributedSetupCoordinatorImpl.ma…
Oct 25, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,3 +33,4 @@ repos:
- execnet>=2.1.0
- types-psutil
- setproctitle
- filelock>=3.13.1
7 changes: 7 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
pytest-xdist 3.ZZZ.ZZZ (2024-zz-zz)
===================================

Features
--------
- `#1126 <https://github.com/pytest-dev/pytest-xdist/pull/1126>`_: New ``isoscope`` scheduler.

pytest-xdist 3.6.1 (2024-04-28)
===============================

Expand Down
13 changes: 13 additions & 0 deletions docs/distribution.rst
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,19 @@ The test distribution algorithm is configured with the ``--dist`` command-line o

.. _distribution modes:

* ``--dist isoscope``: Scope Isolation Scheduler. Tests are grouped by module for
test functions and by class for test methods. Tests are executed one group at a
time, distributed across available workers. This groupwise isolation guarantees
that all tests in one group complete execution before running another group of
tests. This can be useful when module-level or class-level fixtures of one group
could create undesirable side-effects for tests in other test groups, while
taking advantage of distributed execution of tests within each group. Grouping
by class takes priority over grouping by module. NOTE: the use of this scheduler
requires distributed coordination for setup and teardown such as provided by
the ``iso_scheduling`` fixture or an alternate implementation of distributed
coordination - see the ``iso_scheduling.coordinate_setup_teardown`` usage example
in iso_scheduling_plugin.py.

* ``--dist load`` **(default)**: Sends pending tests to any worker that is
available, without any guaranteed order. Scheduling can be fine-tuned with
the `--maxschedchunk` option, see output of `pytest --help`.
Expand Down
2 changes: 2 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ classifiers = [
requires-python = ">=3.8"
dependencies = [
"execnet>=2.1",
"filelock>=3.13.1",
"pytest>=7.0.0",
]
dynamic = ["version"]
Expand All @@ -48,6 +49,7 @@ Tracker = "https://github.com/pytest-dev/pytest-xdist/issues"

[project.entry-points.pytest11]
xdist = "xdist.plugin"
"xdist.iso_scheduling_plugin" = "xdist.iso_scheduling_plugin"
"xdist.looponfail" = "xdist.looponfail"

[project.optional-dependencies]
Expand Down
3 changes: 3 additions & 0 deletions src/xdist/dsession.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
from xdist.remote import Producer
from xdist.remote import WorkerInfo
from xdist.scheduler import EachScheduling
from xdist.scheduler import IsoScopeScheduling
from xdist.scheduler import LoadFileScheduling
from xdist.scheduler import LoadGroupScheduling
from xdist.scheduler import LoadScheduling
Expand Down Expand Up @@ -113,6 +114,8 @@ def pytest_xdist_make_scheduler(
dist = config.getvalue("dist")
if dist == "each":
return EachScheduling(config, log)
if dist == "isoscope":
return IsoScopeScheduling(config, log)
if dist == "load":
return LoadScheduling(config, log)
if dist == "loadscope":
Expand Down
Loading