<div dir="ltr"><div><div><div><div>I'm trying to setup a second worker on a server, and I'm running into some issues with Firefox+Selenium+Xvfb used with some GUI tests.<br><br></div>I'm currently spinning up an instance of Xvfb, since the server is headless, but now that I have two workers, they're breaking each others tests because each tries to cleanup the other's instance of Xvfb.<br><br></div>Is there any way, from inside the Python test, to determine the worker that's executing it? If I can identify some unique property of the process, I can use that to set separate port numbers. I was thinking of just using the process ID, but that alone wouldn't tell me which of the Nth workers the process is running as.<br><br></div>The idea is if my test knows it's running as "worker1", it can strip out the 1, and append that to a base port number, e.g. 8000+1, to use for Xfvb, and only manage the Xvfb process using that port.<br></div></div>