selenium: [🐛 Bug]: downloaded drivers are allegedly not executable
What happened?
I have seen in GitActions unit tests failing in the CI with a ‘RuntimeException: No driver can be provided for capabilities Capabilities …’, e.g.:
- https://github.com/SeleniumHQ/selenium/actions/runs/5668520506/job/15360462919#step:14:295
- https://github.com/SeleniumHQ/selenium/actions/runs/5663173844/job/15345056162#step:14:265
- https://github.com/SeleniumHQ/selenium/actions/runs/5651184041/job/15310430043#step:14:177
So i created a commit to remove the try/catch bock of isAvailable and replaced it with a loop to better hit the issue, see
https://github.com/joerg1985/selenium/commit/829fa6347b579f219795d7abca4cfcdc2d178770
After this i did run the ci pipeline and did see this errors a cause:
- in the remote tests
org.openqa.selenium.remote.NoSuchDriverException: chromedriver located at /home/runner/.cache/selenium/chromedriver/linux64/115.0.5790.102/chromedriver, cannot be executed - in the local tests
org.openqa.selenium.remote.NoSuchDriverException: geckodriver located at /home/runner/.cache/selenium/geckodriver/linux64/0.33.0/geckodriver, cannot be executed
Is it possible that concurrently calling DriverFinder.getPath will cause this issue? I guess the Selenium Manager does not ensure that other instances of the Selenium Manager have completed, before passing the driver path back to the DriverFinder.getPath? Or is the executable flag some how set asynchronous to creating the file? This might also be a bug in the JDK and the File.canExecute() is outdated.
This might also happen outside the Selenium GitHub unit tests, so i decided to raise this ticket to start investigations.
How can we reproduce the issue?
Cherry pick https://github.com/joerg1985/selenium/commit/829fa6347b579f219795d7abca4cfcdc2d178770 to reproduce in GitHub Actions.
Relevant log output
See above
Operating System
GitHub Actions
Selenium version
trunk
What are the browser(s) and version(s) where you see this issue?
chrome, firefox
What are the browser driver(s) and version(s) where you see this issue?
latest
Are you using Selenium Grid?
No response
About this issue
- Original URL
- State: open
- Created a year ago
- Comments: 23 (22 by maintainers)
I think bazel is using multiple processes to run tests in parallel, therefore the singleton does not help to fix
To wait until the driver is executable could be implemented in the selenium manager to have this in one central place. Otherwise it must be implemented for all the client bindings in all languages.
Okay, so we might get others into this.
I am not aware of the rust code, this must someone else check.
Yes, but this does not cover this case.
Yes, i think this is happening here. One SM is still extracting and another SM picks it up before it is ready (marked executable).
This would probably make it not better
That’s a possible workaround, but others might see this effect too on their CI pipeline.