<div dir="ltr">Hi ,<br>
<div><br></div><div>I am trying to use pytest for a SOAK testing environment. So essentially i have a deployment on which i am going to run certain monitoring tests for a given amount of duration.</div><div><br></div><div>I thought xdist can be used to run the monitoring tests on each of the devices in my deployment in parallel. I went through the documentation and code of xdist and also did a little hands on. I have few questions though:</div><div><br></div><div>1. Each of the worker is itself a pytest run.. In my case i will have to do certain device configuration at the beginning of the test run.. that will be common for all the tests. I see that fixtures are executed inside the worker thread only. so i cant use fixtures to do such configuration/revert operations. I was thinking if i can use the hooks that i have defined in the conftest.py in my testpath.. that also is executed only within worker scope.. I understand that we cant make fixtures executed within the master&#39;s scope.. But can the hooks made to be executed within the master&#39;s scope to do such configurations on devices??</div><div><br></div><div>2. I have an internal db where i log all the test run information, logs/results etc.. now these are all logged against a testrun ID which is internally generated. I had all these in the conftest.py for my functional environment. But here again since workers are executing the conftest.py files each of them are considered a separate testrun, which is  not desirable for me. I saw that execnet channel is used to send command strings between master and slaves.. But i dont see a way to extend it unless i modify the xdist plugin itself... How  can this be achieved.</div><div><br></div><div>3. I tried xdist with some demo cases, but when i run the  whole test file collection mismatch is happening. Logs below:</div><div><br></div><div><div>gw0 [20] / gw1 [20]</div><div>scheduling tests via LoadScheduling</div><div><br></div><div>―――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――― ERROR collecting gw1 ――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――</div><div>Different tests were collected between gw0 and gw1. The difference is:</div><div>--- gw0</div><div><br></div><div>+++ gw1</div><div><br></div><div>@@ -1,20 +1,20 @@</div><div><br></div><div>+test_tc.py::test_demo008</div><div>+test_tc.py::test_demo009[set1-subset1]</div><div>+test_tc.py::test_demo005</div><div>+test_tc.py::test_demo009[set2-subset1]</div><div>+test_tc.py::test_demo002</div><div>+test_tc.py::test_demo009[set3-subset2]</div><div>+test_tc.py::test_demo001</div><div>+test_tc.py::test_shapingIpv4</div><div>+test_tc.py::test_demo009[set1-subset3]</div><div> test_tc.py::test_demo009[set3-subset3]</div><div>+test_tc.py::test_demo010</div><div>+test_tc.py::test_demo006</div><div>+test_tc.py::test_demo009[set1-subset2]</div><div>+test_tc.py::test_demo009[set3-subset1]</div><div>+test_tc.py::test_demo004</div><div>+test_tc.py::test_demo009[set2-subset3]</div><div>+test_tc.py::test_demo011</div><div>+test_tc.py::test_demo007</div><div> test_tc.py::test_demo009[set2-subset2]</div><div>-test_tc.py::test_demo005</div><div>-test_tc.py::test_demo009[set1-subset2]</div><div>-test_tc.py::test_shapingIpv4</div><div>-test_tc.py::test_demo009[set1-subset1]</div><div>-test_tc.py::test_demo009[set1-subset3]</div><div>-test_tc.py::test_demo002</div><div>-test_tc.py::test_demo007</div><div> test_tc.py::test_demo003</div><div>-test_tc.py::test_demo008</div><div>-test_tc.py::test_demo009[set3-subset1]</div><div>-test_tc.py::test_demo011</div><div>-test_tc.py::test_demo006</div><div>-test_tc.py::test_demo009[set3-subset2]</div><div>-test_tc.py::test_demo004</div><div>-test_tc.py::test_demo010</div><div>-test_tc.py::test_demo009[set2-subset1]</div><div>-test_tc.py::test_demo001</div><div>-test_tc.py::test_demo009[set2-subset3]</div><div><br></div><div><br></div><div>Results (8.79s):</div></div><div><br></div><div>what could be the reason for this?</div><div><br></div><div>Regards,</div><div>Arun kaliraja.B</div></div>