You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Generalize SocketLock to account for Chrome port race condition
When the Chrome browser boots up via the Ruby library, it attempts
to find a free port and launch the bridge on that port. However, it's
possible that, if you're running tests in parallel, two bridges will
try to bind to the same port at the same time. This will cause a very
obtuse "end of file" error as documented [here][1].
This patch is based on one initially proposed in the original
[bug report][2]. However, it goes a step further, taking the technical
comments into account, and generalizing the `SocketLock` class used
in the Firefox launcher to assist.
[1]: grosser/parallel_tests#322
[2]: https://code.google.com/p/selenium/issues/detail?id=8241
Signed-off-by: Alexei Barantsev <[email protected]>
Copy file name to clipboardExpand all lines: rb/lib/selenium/webdriver/chrome/service.rb
+47-21Lines changed: 47 additions & 21 deletions
Original file line number
Diff line number
Diff line change
@@ -22,14 +22,12 @@ module Chrome
22
22
#
23
23
# @api private
24
24
#
25
-
26
25
classService
27
-
START_TIMEOUT=20
28
-
STOP_TIMEOUT=5
29
-
DEFAULT_PORT=9515
30
-
MISSING_TEXT="Unable to find the chromedriver executable. Please download the server from http://chromedriver.storage.googleapis.com/index.html and place it somewhere on your PATH. More info at https://github.com/SeleniumHQ/selenium/wiki/ChromeDriver."
31
-
32
-
attr_reader:uri
26
+
START_TIMEOUT=20
27
+
SOCKET_LOCK_TIMEOUT=45
28
+
STOP_TIMEOUT=5
29
+
DEFAULT_PORT=9515
30
+
MISSING_TEXT="Unable to find the chromedriver executable. Please download the server from http://chromedriver.storage.googleapis.com/index.html and place it somewhere on your PATH. More info at https://github.com/SeleniumHQ/selenium/wiki/ChromeDriver."
0 commit comments