You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am having an issue with parallel execution when using Xvfb.
For the purposes of testing, I am attempting to run programs on several virtual displays at once, as well as some on the physical display. I need to run some things on the physical display for the tests to work on MacOS (Xvfb on Xquartz is not compiled with support for the GLX extension by default and some of the programs I am trying to run make use of OpenGL).
Currently the only way I see to run all of this is to use a resource lock for physical and virtual displays alike. This is because os.environ['DISPLAY'] is overwritten when the Xvfb instance is started and restored to its original value when it is stopped. I would like to avoid this as it would greatly slow down the testing.
Based on my understanding of the xvfbwrapper code, the problem would be fixed by an optional argument environ which is modified in place of os.environ (which would be the default value for the variable).
This would prevent other threads being exposed to the change in the DISPLAY variable but still make use of the resource locking that currently occurs for virtual displays. Would a PR for this functionality be welcome/accepted?
Another detail that may or may not be relevant is that I am running this using pytest and the pytest-parallel plugin with the --worker flag for several processes at once... or at least the documentation indicates that each worker is run in a separate process but my understanding is that os.environ changes would not effect the environment of other workers.
The text was updated successfully, but these errors were encountered:
I am having an issue with parallel execution when using Xvfb.
For the purposes of testing, I am attempting to run programs on several virtual displays at once, as well as some on the physical display. I need to run some things on the physical display for the tests to work on MacOS (Xvfb on Xquartz is not compiled with support for the GLX extension by default and some of the programs I am trying to run make use of OpenGL).
Currently the only way I see to run all of this is to use a resource lock for physical and virtual displays alike. This is because os.environ['DISPLAY'] is overwritten when the Xvfb instance is started and restored to its original value when it is stopped. I would like to avoid this as it would greatly slow down the testing.
Based on my understanding of the xvfbwrapper code, the problem would be fixed by an optional argument environ which is modified in place of os.environ (which would be the default value for the variable).
So usage would be something like:
This would prevent other threads being exposed to the change in the DISPLAY variable but still make use of the resource locking that currently occurs for virtual displays. Would a PR for this functionality be welcome/accepted?
Another detail that may or may not be relevant is that I am running this using pytest and the pytest-parallel plugin with the --worker flag for several processes at once... or at least the documentation indicates that each worker is run in a separate process but my understanding is that os.environ changes would not effect the environment of other workers.
The text was updated successfully, but these errors were encountered: