Execution order of pytest_runtestloop hook in the controller and worker nodes. #1214
sashko1988
started this conversation in
General
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I need to share some data between the controller and worker nodes.
That data is created on the controller node, then saved to a file and shared between workers.
Nodes (controller and worker) do that during
pytest_runtestloop
hook.Sometimes, when I set a high number of workers >= 20, some of the workers attempt to open the file before the controller node has created it.
Code snippet:
I use file locks to prevent race conditions in
create_file()
andprocess_file()
. However, it is still designed around the assumption that the controller is the first to executepytest_runtestloop
.Also, does xdist have a built-in mechanism to share data between nodes when a worker node has already been set up?UPD I just saw this - #1213 (comment), so I used the only mechanism.
But the question about execution order remains.
Beta Was this translation helpful? Give feedback.
All reactions