I ran into a problem when running GUI tests in parallel inside a Docker container. I use a bunch: Selenium webdriver + Pytest + Xdist + Chrome.
I use following command to run the tests:
pytest -v -n=4 --headless=True --production=True --browser=chrome --dist=loadfile --junitxml=test.xml
But all the tests fail. If I do the same outside the docker container or use 1 thread - it's working fine.
So, how can I resolve this problem and execute tests in parallel inside the docker container? Thanks a lot)
I have this in logs:
selenium.common.exceptions.WebDriverException: Message: chrome not reachable (Session info: headless chrome=73.0.3683.86) (Driver info: chromedriver=73.0.3683.20 (8e2b610813e167eee3619ac4ce6e42e3ec622017),platform=Linux 4.15.0-46-generic x86_64)
Try to use boxed
processes + tx
flag: (--tx 3*popen//python=python3.6 --boxed
, so run your tests with the command below:
pytest -v --headless=True --production=True --browser=chrome --dist=loadfile --junitxml=test.xml --tx 3*popen//python=python3.6 --boxed
More information of how you can run your tests in parallel is available under that SO answer .
Good Luck !
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With