I have two browser types: firefox (40 instances) and chrome (40 instances) on my selenium grid. Also, I have a bunch of tests, some of them need to be executed on firefox, some of them under chrome. Some of them do not care.
First solution, that was advised by @skrrgwasme was to divide tests that do not need specific browsers on two groups, to have, finally two queues (one - to be executed on firefox, second to be executed on chrome): How to implement custom control over python multiprocessing.Pool?
This solution is nice, but still can be enhanced: as browser handle their requests with different speed, chrome will finish its queue much faster, and firefox queue will work much longer. This can be solved with custom continuous control, when I decide which browser to use not before creating pools, but when those pool are already started.
So, we should have one pool, where every process spawn is controlled by us.
@skrrgwasme advised to use apply_async for this. But I just can't understand how this can be achieved in python, as it is not async like node.js.
Could you please share some examples? I have very tiny experience with python, and seem to be totally stuck with this :(