Skip to content

Commit aa8e066

Browse files
Aaron McKinleyp0deje
authored andcommitted
Update Http.request in default.rb to include a delay in retries
Update Http.request to include a sleep between retries for cases where Errno::ECONNABORTED, Errno::ECONNRESET, Errno::EADDRINUSE occur. Without this sleep the retries happen immediately and do not give the remote host and/or connection to it, any time to resolve the connection issue. This results in seemingly random connection problems and test failures when using Selenium Webdriver in a grid setup with 1000s of connections running simultaneously. Signed-off-by: Alex Rodionov <p0deje@gmail.com>
1 parent 90216e9 commit aa8e066

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

rb/lib/selenium/webdriver/remote/http/default.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ def request(verb, url, headers, payload, redirects = 0)
8484
# http://msdn.microsoft.com/en-us/library/aa560610%28v=bts.20%29.aspx
8585
raise if retries >= MAX_RETRIES
8686
retries += 1
87-
87+
sleep 2
8888
retry
8989
rescue Errno::EADDRNOTAVAIL => ex
9090
# a retry is sometimes needed when the port becomes temporarily unavailable

0 commit comments

Comments
 (0)