S
S
Sergey2019-04-10 20:44:49
Python
Sergey, 2019-04-10 20:44:49

How to run parallel execution of Pytest tests inside a Docker container?

Good day!
I'm using Python3 + Pytest + Selenium + Chrome + Docker to test the interface of a web application. There is also pytest-xdist to parallelize the execution of test suites. When I run in 4-5 threads on the local machine (windows / linux), the tests are run in parallel (in headless mode). But when the same tests are run in Docker, all tests fail.

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)

Do I understand correctly that this can happen because multiple browser instances cannot be running? Or, perhaps, some dependencies are missing, but it is not possible to understand which ones (I am not very friendly with linux). And in general, maybe there is any ready-made solution for running tests in parallel in Docker?
There is just one mega-hacky solution - to create several jobs in jenkins for different "packs" of test suites. But it's too perverted.

Answer the question

In order to leave comments, you need to log in

5 answer(s)
1
1001001, 2019-04-10
@1001001

https://hub.docker.com/u/selenoid/
https://aerokube.com/selenoid/latest/
but in general it just can't find the driver

S
Stalker_RED, 2017-02-10
@Stalker_RED

Because the location must be specified correctly. There should be a full path, for good.
Type

header('Location: http://example.com/ekzo/index.php');

U
ukoHka, 2017-02-10
@ukoHka

Due to the lack of additional information, the most likely is that the condition is not met. Usually, the Exit button is made a link, not a submit. Try $_GET['logout'], instead of $_POST['logout'].

A
Anton B, 2017-02-10
@bigton

1. Both relative and absolute paths will work in location.
2. Try after header(), put exit().

T
ThunderCat, 2017-02-10
@ThunderCat

I see here there is a selection for the battle of psychics)
Make it a rule to check the actions step by step if something doesn’t work, first leave only the line with the redirect, without the if, then it’s logical to check what falls into the check condition, and so on.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question