pytest-dev / pytest-dev/pytest-xdist

Inconsistent Test Execution on Different Workers

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

Nobody has claimed this yet.

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

Description

Short summary: automation tests split into two groups, one needing a precondition fixture based on worker nodes. During Jenkins runs, test groups execute on different workers each time, causing inconsistency

Description:
Hello all!

I have a next issue and cannot fix it for a while.
So, we have a UI automation repo, with 200 tests. All this test are separated in 2 big groups using pytest.mark.xdist_group
For one group, lets say G1 is required to execute one precondition fixture, and for G2 we dont need this fixture.
And we have next implementation in the code like:
if node == "gw1":
yield
else:
required precondition
And the issue is, every time during jenkins job execution, ours test group executing in diff workers.
Like today G1 tests will run on gw0, and tomorrow G1 tests will run on gw1

Do you know how to fix this ?

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 with the reported pytest.mark.xdist_group and worker-node fixture behavior, then reproduce the differing gw0/gw1 assignments in a Jenkins run. Inspect how pytest-xdist exposes worker identity and how the precondition fixture is selected; done means establishing a consistent, documented way for the two test groups to receive the intended fixture behavior.

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.