pytest-dev / pytest-dev/pytest-xdist

Tests not selected when running with -n auto --dist loadgroup

Open
#1,134 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
1.9k
Forks
288
Avg merge
9h 30m
Merged PRs (30d)
2

Description

Summary:

I am encountering an issue where no test cases are selected when running tests in parallel with pytest-xdist using the arguments -n auto --dist loadgroup. This issue arose suddenly, and previously, the same setup worked fine.

My test suite includes the use of the @pytest.mark.xdist_group(name="quotation") decorator to group related tests, ensuring they run on the same worker. However, now the test run outputs 0 cases selected, despite tests running correctly without the --dist loadgroup option.

When running the tests without these arguments, tests are executed correctly.

Details:
Environment:
Python version: 3.9.11
pytest version: 8.0.2
pytest-xdist version: 2.5.0
Running tests in a Linux environment via Jenkins.
Error/Output:

[INFO]: 0 个cases selected
============================= test session starts ==============================
platform linux -- Python 3.9.11, pytest-8.0.2, pluggy-1.5.0 -- /usr/bin/python
cachedir: .pytest_cache

Did anything changed that can affect this?

Thank you in advance!

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the reported command, -n auto --dist loadgroup, with Python 3.9.11, pytest 8.0.2, and pytest-xdist 2.5.0, then compare it with the same suite without --dist loadgroup. Trace how @pytest.mark.xdist_group(name="quotation") affects test selection; done means identifying why zero cases are selected and verifying the behavior with a regression test.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
distributed-systems, testing-qa
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.