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] speed up Service launch (sleep depending on the number of attempts to check if the service has started) #13321

Merged
merged 2 commits into from
Dec 18, 2023
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/common/service.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,10 +102,10 @@ def start(self) -> None:
self.assert_process_still_running()
if self.is_connectable():
break

# sleep increasing: 0.01, 0.06, 0.11, 0.16, 0.21, 0.26, 0.31, 0.36, 0.41, 0.46, 0.5
sleep(min(0.01 + 0.05 * count, 0.5))
count += 1
sleep(0.5)
if count == 60:
if count == 70:
raise WebDriverException(f"Can not connect to the Service {self._path}")

def assert_process_still_running(self) -> None:
Expand Down