Skip to content

Commit

Permalink
Python client: sleep depending on the number of attempts to check if …
Browse files Browse the repository at this point in the history
…the service has started (#13321)

sleep depending on the number of attempts to check if the service has started (0.01-0.5)

Co-authored-by: Diego Molina <diemol@users.noreply.github.com>
  • Loading branch information
deedy5 and diemol committed Dec 18, 2023
1 parent 173d624 commit 98ea560
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions py/selenium/webdriver/common/service.py
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

0 comments on commit 98ea560

Please sign in to comment.