Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[🐛 Bug]: Selenium Manager sometimes fails in parallel test run #11620

Closed
attila-fazekas opened this issue Feb 6, 2023 · 6 comments · Fixed by #11640
Closed

[🐛 Bug]: Selenium Manager sometimes fails in parallel test run #11620

attila-fazekas opened this issue Feb 6, 2023 · 6 comments · Fixed by #11640

Comments

@attila-fazekas
Copy link

What happened?

Have noticed that sometimes Selenium Manager fails to configure driver executable path if tests are run in parallel.

Environment:
Java: Oracle OpenJDK 17.0.2
Gradle: 7.4

Was able to reproduce it both with jUnit and TestNG, please see the code in the repository below.

Before running tests, make sure neither specific driver locations provided, nor PATH environment variable set for drivers.
Run the tests until you get java.lang.IllegalStateException: The path to the driver executable... exception.

How can we reproduce the issue?

https://github.com/attila-fazekas/selenium-manager-parallel-run

Relevant log output

https://github.com/attila-fazekas/selenium-manager-parallel-run/tree/main/logs

Operating System

macOS Mojave

Selenium version

Java 4.8

What are the browser(s) and version(s) where you see this issue?

Chrome 109.0.5414.119, Firefox 108.0.1, Edge 109.0.1518.70

What are the browser driver(s) and version(s) where you see this issue?

ChromeDriver 109.0.5414.74, GeckoDriver 0.32.0, EdgeDriver 109.0.1518.70

Are you using Selenium Grid?

No

@github-actions
Copy link

github-actions bot commented Feb 6, 2023

@attila-fazekas, thank you for creating this issue. We will troubleshoot it as soon as we can.


Info for maintainers

Triage this issue by using labels.

If information is missing, add a helpful comment and then I-issue-template label.

If the issue is a question, add the I-question label.

If the issue is valid but there is no time to troubleshoot it, consider adding the help wanted label.

If the issue requires changes or fixes from an external project (e.g., ChromeDriver, GeckoDriver, MSEdgeDriver, W3C), add the applicable G-* label, and it will provide the correct link and auto-close the issue.

After troubleshooting the issue, please add the R-awaiting answer label.

Thank you!

@titusfortner
Copy link
Member

Looks like a permission denied error. This is intermittent?
I'm not sure what might be happening from the OS standpoint; @bonigarcia / @p0deje any ideas here?

I wonder if we implemented #11359 instead of extracting to separate temporary directories if that might fix it?

@bonigarcia
Copy link
Member

bonigarcia commented Feb 8, 2023

@attila-fazekas Thanks a lot for reporting. I have confirmed this problem using the provided parallel test. The underlying cause is the following:

IOException running command [C:\Users\boni\AppData\Local\Temp\selenium-manager368516221190010136870019813379420\selenium-manager.exe, --driver, geckodriver]: Cannot run program "C:\Users\boni\AppData\Local\Temp\selenium-manager368516221190010136870019813379420\selenium-manager.exe": CreateProcess error=32, The process cannot access the file because it is being used by another process

@titusfortner Yes, maybe extracting to a separate folder (like ~\.cache\selenium) might help to solve the problem, although I would need to test it.

I discussed the benefits of having the Selenium Manager binary in the cache in #11517. To do that, I think there are two alternatives:

  1. Extract it from the bindings (e.g., the JAR in Java) and copy it into the cache (then use it when available).
  2. Download from GitHub (i.e., implementing a mini-manager in each binding).

I suppose some decision about it needs to be taken (in a TLC meeting?).

@titusfortner
Copy link
Member

We already discussed caching the manager at a previous TLC meeting; we don't need to implement the mini-manager to support just the caching.

Though, thinking through this, we might need to implement retry functionality in the bindings, because two threads calling the binary at the same time is still going to have this issue.

This is probably a bindings fix and not a rust fix?

@bonigarcia
Copy link
Member

Yes, it seems it is an issue on the side of the binding (Java, in this case).

@bonigarcia
Copy link
Member

I found an easy fix for this, see PR #11640.

@github-actions github-actions bot locked and limited conversation to collaborators Dec 9, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants