Skip to content
Open
Changes from 1 commit
Commits
Show all changes
52 commits
Select commit Hold shift + click to select a range
124ffc0
Introducing contributed code for isoscope scheduling.
vkruglik-aka Sep 6, 2024
ed63fe4
Integrate isoscope scheduling and distributed sccope isolation into x…
vkruglik-aka 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.
vkruglik-aka 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.
vkruglik-aka 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.
vkruglik-aka 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.
vkruglik-aka 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.
vkruglik-aka Sep 9, 2024
1b9f92d
Add isoscope parametrization to generic acceptance tests test_single_…
vkruglik-aka 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…
vkruglik-aka 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 …
vkruglik-aka 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.
vkruglik-aka Oct 23, 2024
95a16a6
Fix expected counts in TestIsoScope test_by_module, test_by_class, an…
vkruglik-aka Oct 23, 2024
61f5fad
Implemented acceptance test TestIsoScope.test_single_scope_all_worker…
vkruglik-aka 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_…
vkruglik-aka 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 …
vkruglik-aka 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…
vkruglik-aka Oct 23, 2024
a4398b2
Removed extraneous setdefault in acceptance test TestIsoScope.test_si…
vkruglik-aka Oct 23, 2024
47fcf7a
Implemented acceptance test TestIsoScope.test_multi_scope_with_insuff…
vkruglik-aka 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…
vkruglik-aka Oct 24, 2024
0e00ed9
Fixed TestFenceA/B search patterin in acceptance test TestIsoScope.te…
vkruglik-aka Oct 24, 2024
fa97762
Fix test_fence_scopes pytest filename in acceptance test TestIsoScope…
vkruglik-aka Oct 24, 2024
3b7f2de
Implemented acceptance test TestIsoScope.test_two_tests_min_per_worke…
vkruglik-aka 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…
vkruglik-aka 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…
vkruglik-aka Oct 25, 2024
6aa321d
Work in progress on acceptance test TestIsoScope.test_distributed_set…
vkruglik-aka Oct 25, 2024
d110668
Work in progress on acceptance test TestIsoScope.test_distributed_set…
vkruglik-aka Oct 25, 2024
46f33a6
Work in progress on acceptance test TestIsoScope.test_distributed_set…
vkruglik-aka Oct 25, 2024
4711108
Work in progress on acceptance test TestIsoScope.test_distributed_set…
vkruglik-aka Oct 25, 2024
5f988d9
Work in progress on acceptance test TestIsoScope.test_distributed_set…
vkruglik-aka 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…
vkruglik-aka 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…
vkruglik-aka Oct 25, 2024
b71c911
Removed whitespace from blank lines.
vkruglik-aka Oct 25, 2024
06fe668
Initialize the status file used by underlying test in TestIsoScope.te…
vkruglik-aka Oct 25, 2024
b1f032d
Create parent directories for the status file used by underlying test…
vkruglik-aka Oct 25, 2024
52c0815
Fixed SyntaxError: (unicode error) 'unicodeescape' codec can't decode…
vkruglik-aka Oct 25, 2024
95b91c8
Fix node_path.relative_to(...) in _DistributedSetupCoordinatorImpl.ma…
vkruglik-aka 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
Prev Previous commit
Next Next commit
Address pre-commit findings concerning the use of tuple vs Tuple and …
…List vs list in type hings, favoring list and tuple.
  • Loading branch information
vkruglik-aka committed Oct 25, 2024
commit 7a29564239d5c2e1ef7dd03b59574eee82c0c78c
26 changes: 13 additions & 13 deletions src/xdist/scheduler/isoscope.py
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ def __init__(self, config: pytest.Config, log: xdist.remote.Producer):
# is performed once the number of registered node collections reaches
# `_expected_num_workers`. It is initialized to None and then updated
# after validation succeeds.
self._official_test_collection: Tuple[str, ...] | None = None
self._official_test_collection: tuple[str, ...] | None = None
# Remote worker node having `_official_test_collection` as its test
# collection (for reporting failed collection validations)
self._official_test_collection_node: WorkerController | None = None
Expand Down Expand Up @@ -184,7 +184,7 @@ def __init__(self, config: pytest.Config, log: xdist.remote.Producer):
)

@property
def nodes(self) -> List[WorkerController]:
def nodes(self) -> list[WorkerController]:
"""A new list of all active `WorkerController` nodes.

Called by xdist `DSession`.
Expand Down Expand Up @@ -536,7 +536,7 @@ def _reschedule_workers(self) -> None:
"""Distribute work to workers if needed at this time."""
assert self._state is not None

traversed_states: List[IsoScopeScheduling._State] = []
traversed_states: list[IsoScopeScheduling._State] = []
previous_state = None
while self._state != previous_state:
# NOTE: This loop will terminate because completion of tests and
Expand Down Expand Up @@ -764,7 +764,7 @@ def _handle_state_fence(self) -> None:
self._log(f"Transitioned from {previous_state!s} to " f"{self._state!s}")

def _distribute_workset(
self, workset: _ScopeWorkset, workers: List[_WorkerProxy]
self, workset: _ScopeWorkset, workers: list[_WorkerProxy]
) -> None:
"""Distribute the tests in the given workset to the given workers.

Expand Down Expand Up @@ -979,7 +979,7 @@ def _get_max_workers_for_num_tests(num_tests: int) -> int:

def _get_workers_available_for_distribution(
self, scope_id: str
) -> List[_WorkerProxy]:
) -> list[_WorkerProxy]:
"""Return workers available for distribution of the given Scope.

Available workers are non-shutting-down workers that either
Expand All @@ -1003,7 +1003,7 @@ def _get_workers_available_for_distribution(
)
]

def _get_workers_ready_for_fencing(self, scope_id: str) -> List[_WorkerProxy]:
def _get_workers_ready_for_fencing(self, scope_id: str) -> list[_WorkerProxy]:
"""Return workers that are ready to be Fenced for the given test Scope.

A worker that needs to be Fenced satisfies all the following conditions:
Expand All @@ -1028,9 +1028,9 @@ def _get_workers_ready_for_fencing(self, scope_id: str) -> List[_WorkerProxy]:
def _do_two_nodes_have_same_collection(
self,
reference_node: WorkerController,
reference_collection: Tuple[str, ...],
reference_collection: tuple[str, ...],
node: WorkerController,
collection: Tuple[str, ...],
collection: tuple[str, ...],
) -> bool:
"""
If collections differ, this method returns False while logging
Expand Down Expand Up @@ -1081,7 +1081,7 @@ def __init__(self, node: WorkerController):

# An ordered collection of test IDs collected by the remote worker.
# Initially None, until assigned by the Scheduler
self._collection: Tuple[str, ...] | None = None
self._collection: tuple[str, ...] | None = None

self._pending_test_by_index: OrderedDict[int, _TestProxy] = OrderedDict()

Expand All @@ -1094,15 +1094,15 @@ def node(self) -> WorkerController:
return self._node

@property
def collection(self) -> Tuple[str, ...] | None:
def collection(self) -> tuple[str, ...] | None:
"""
:return: An ordered collection of test IDs collected by the remote
worker; `None` if the collection is not available yet.
"""
return self._collection

@collection.setter
def collection(self, collection: Tuple[str, ...]) -> None:
def collection(self, collection: tuple[str, ...]) -> None:
"""
:param collection: An ordered collection of test IDs collected by the
remote worker. Must not be `None`. Also, MUST NOT be set already.
Expand Down Expand Up @@ -1211,7 +1211,7 @@ def handle_test_completion(self, test_index: int) -> None:
# Remove the test from the worker's pending queue
self._pending_test_by_index.pop(test_index)

def release_pending_tests(self) -> List[_TestProxy]:
def release_pending_tests(self) -> list[_TestProxy]:
"""Reset the worker's pending tests, returning those pending tests.

:return: A (possibly empty) list of pending tests.
Expand Down Expand Up @@ -1316,7 +1316,7 @@ def enqueue_test(self, test: _TestProxy) -> None:
# Update high watermark
self._high_water = max(self._high_water, len(self._test_by_index))

def dequeue_tests(self, num_tests: int) -> List[_TestProxy]:
def dequeue_tests(self, num_tests: int) -> list[_TestProxy]:
"""
Remove and return the given number of tests from the head of the
collection.
Expand Down