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

Inconsistent Test Execution on Different Workers #1031

Open
SviatoslavKovalchuk opened this issue Feb 29, 2024 · 1 comment
Open

Inconsistent Test Execution on Different Workers #1031

SviatoslavKovalchuk opened this issue Feb 29, 2024 · 1 comment
Labels

Comments

@SviatoslavKovalchuk
Copy link

SviatoslavKovalchuk commented Feb 29, 2024

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 ?

@nicoddemus
Copy link
Member

Right now you cannot force a specific worker for tests grouped using xdist_group, the only guarantee is that they will executing in the same worker; like you described, it is possible for example for the tests of the same group execute all in gw1 in the first session, then gw7 in the next, and so on.

The purpose of the feature is not to specify exactly which worker to run on, just to ensure that tests of the same group execute in the same worker.

If you group your tests according to your "precondition fixtures", things should work out OK, it should not matter if "G1" tests execute on gw0 or gw1, as long as they execute in the same worker.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants