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

[py] Avoid waiting indefinitely on a frozen chromedriver process #14578

Merged
merged 1 commit into from
Oct 18, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions py/selenium/webdriver/remote/remote_connection.py
Original file line number Diff line number Diff line change
Expand Up @@ -305,7 +305,7 @@ def execute(self, command, params):
LOGGER.debug("%s %s %s", command_info[0], url, str(trimmed))
return self._request(command_info[0], url, body=data)

def _request(self, method, url, body=None):
def _request(self, method, url, body=None, timeout=120):
"""Send an HTTP request to the remote server.

:Args:
Expand All @@ -323,12 +323,12 @@ def _request(self, method, url, body=None):
body = None

if self.keep_alive:
response = self._conn.request(method, url, body=body, headers=headers)
response = self._conn.request(method, url, body=body, headers=headers, timeout=timeout)
statuscode = response.status
else:
conn = self._get_connection_manager()
with conn as http:
response = http.request(method, url, body=body, headers=headers)
response = http.request(method, url, body=body, headers=headers, timeout=timeout)
statuscode = response.status
data = response.data.decode("UTF-8")
LOGGER.debug("Remote response: status=%s | data=%s | headers=%s", response.status, data, response.headers)
Expand Down
Loading