Specifying the session_worker at the class level sets the fixture name to be session scoped even though the tests itself is function scoped. This causes issues with our ordering to run session function scoped tasks last. The result is workers from session scoped tests can pickup function scoped tests jobs, vice-versa.
What was the solution? (How)
Remove @pytest.mark.usefixtures("session_worker") and specify the scope on each test.
What is the impact of this change?
This is to prevent function and session scoped tests from running at the same time.
Now <Function test_worker_enters_stopping_state_while_draining[linux]> which was previously run with the session scoped tests is now running prior to session scope.
Was this change documented?
No
Is this a breaking change?
No
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.
What was the problem/requirement? (What/Why)
Specifying the session_worker at the class level sets the fixture name to be session scoped even though the tests itself is function scoped. This causes issues with our ordering to run session function scoped tasks last. The result is workers from session scoped tests can pickup function scoped tests jobs, vice-versa.
What was the solution? (How)
Remove
@pytest.mark.usefixtures("session_worker")
and specify the scope on each test.What is the impact of this change?
This is to prevent function and session scoped tests from running at the same time.
How was this change tested?
On both Linux and Windows:
Check Collection order:
Now
<Function test_worker_enters_stopping_state_while_draining[linux]>
which was previously run with the session scoped tests is now running prior to session scope.Was this change documented?
No
Is this a breaking change?
No
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.