aerokube / selenoid

Selenium Hub successor running browsers within containers. Scalable, immutable, self hosted Selenium-Grid on any platform with single binary.
https://aerokube.com/selenoid/latest/
Apache License 2.0
2.57k stars 321 forks source link

Selenoid created new session before stop MicrosoftWebDriver for Edge browser on Windows #223

Open mdolinin opened 6 years ago

mdolinin commented 6 years ago

Steps to reproduce:

  1. Start selenoid on Windows with -limit 1 -disable-docker parameters
  2. Run two tests that use MicrosoftEdge browser in parallel

Actual result: Second test will fail with 500 internal error from MicrosoftWebDriver

Expected result: Second test continue running as first one

Details: In selenoid output we can see that new session is started before MicrosoftWebDriver is stoped by selenoid. For now Microsoft Edge doesn't support to run multiple sessions simultaneously https://developer.microsoft.com/en-us/microsoft-edge/platform/issues/7186486/

Workaround:

  1. Create separate batch file with timeout before starting new MicrosoftWebDriver process
  2. In browsers.json set to run your batch file instead of MicrosoftWebDriver directly
vania-pooh commented 6 years ago

Using batch files can lead to memory leak because Windows has no way to destroy the entire process tree with all child subprocesses.

mdolinin commented 6 years ago

Agree. I forgot to write that you need to kill previous MicrosoftWebDriver process in batch file. But this is workaround. Hope you can fix this issue and we can use it without this hack. :)

vania-pooh commented 6 years ago

@mdolinin so you are saying that we can't start 2+ processes of EdgeDriver in parallel?

mdolinin commented 6 years ago

Yes. You can start few EdgeDriver processes, but when you try to use them they will response with 500 internal error

vania-pooh commented 6 years ago

Ok, let me check this assumption first. If Edge does not support multiple sessions - the only thing we can do is to wait for this feature to be implemented.

vania-pooh commented 6 years ago

I investigated the situation a bit more and can confirm that this is an Edge internal limitation which should be fixed in subsequent releases. I think this could be because of the hard-coded debug port used for communication or essentially single-threaded debugger implementation. Anyway let's wait for the next Edge update to see whether they have fixed the issue.

vania-pooh commented 6 years ago

Still reproduces with Edge 16.16299 and latest EdgeDriver.