Conversation
Tests that lock heavy shared resources (e.g. governance) can now
be marked with `@pytest.mark.xdist_split("<key>")`. Unlike
`xdist_group`, split tests are NOT grouped onto one worker; each
gets its own per-test scope and the scheduler caps the number of
in-flight tests sharing a key at the cluster instance capacity
(CLUSTERS_COUNT env, falling back to xdist worker count bounded
by 9). A test locking multiple resources can declare several
keys at once via a comma-separated value, e.g.
`xdist_split("governance,plutus")`; the cap applies independently
per key.
Without the cap, when many same-key tests are collected together
xdist hands them out at once to many workers; workers beyond the
instance capacity then sit blocked in the cluster manager waiting
for the shared resource to free up, instead of running unrelated
non-conflicting tests that could share those same instances in
parallel.
Apply the new split-key dispersion to conway governance tests so they get spread across xdist workers instead of piling up behind each other on the same cluster instances.
Apply split-key dispersion to the upgrade-step plutus_v3 test that contends for governance cluster resources.
Contributor
There was a problem hiding this comment.
Pull request overview
This PR extends the repository’s custom pytest-xdist scheduler to support a new “split” concept for tests that contend on heavyweight shared resources (e.g., governance setup). It introduces an xdist_split marker that lets those tests be dispersed across workers while capping concurrent in-flight tests per split key to the available cluster-instance capacity, avoiding mass worker stalls.
Changes:
- Added two pytest markers:
xdist_group(group onto one worker) andxdist_split(spread across workers with concurrency cap). - Enhanced the custom xdist scheduler to (1) keep long-test balancing and (2) avoid overscheduling tests sharing the same split key beyond cluster capacity.
- Annotated several governance-/plutus-heavy tests with
@pytest.mark.xdist_split(...)to enable the new scheduling behavior.
Reviewed changes
Copilot reviewed 11 out of 11 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
pyproject.toml |
Registers xdist_group / xdist_split markers to avoid unknown-marker warnings and document intent. |
cardano_node_tests/pytest_plugins/xdist_scheduler.py |
Implements split-key parsing, per-key in-flight caps, and integrates this into scheduling decisions. |
cardano_node_tests/tests/tests_plutus_v3/test_mint_build.py |
Marks a heavy test with xdist_split("governance"). |
cardano_node_tests/tests/tests_conway/test_update_plutusv2_builtins.py |
Marks a heavy test with xdist_split("governance,plutus"). |
cardano_node_tests/tests/tests_conway/test_pparam_update.py |
Marks a heavy test with xdist_split("governance,plutus"). |
cardano_node_tests/tests/tests_conway/test_no_confidence.py |
Marks heavy governance tests with xdist_split("governance"). |
cardano_node_tests/tests/tests_conway/test_hardfork.py |
Marks the hardfork test with xdist_split("governance"). |
cardano_node_tests/tests/tests_conway/test_guardrails.py |
Marks guardrails test with xdist_split("governance"). |
cardano_node_tests/tests/tests_conway/test_drep.py |
Marks DRep inactivity test with xdist_split("governance"). |
cardano_node_tests/tests/tests_conway/test_constitution.py |
Marks constitution change test with xdist_split("governance"). |
cardano_node_tests/tests/tests_conway/test_committee.py |
Marks multiple committee-related heavy tests with xdist_split("governance"). |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
No description provided.