Skip to content

Commit 98ea560

Browse files
deedy5diemol
andauthored
Python client: sleep depending on the number of attempts to check if 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 <[email protected]>
1 parent 173d624 commit 98ea560

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

py/selenium/webdriver/common/service.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -102,10 +102,10 @@ def start(self) -> None:
102102
self.assert_process_still_running()
103103
if self.is_connectable():
104104
break
105-
105+
# sleep increasing: 0.01, 0.06, 0.11, 0.16, 0.21, 0.26, 0.31, 0.36, 0.41, 0.46, 0.5
106+
sleep(min(0.01 + 0.05 * count, 0.5))
106107
count += 1
107-
sleep(0.5)
108-
if count == 60:
108+
if count == 70:
109109
raise WebDriverException(f"Can not connect to the Service {self._path}")
110110

111111
def assert_process_still_running(self) -> None:

0 commit comments

Comments
 (0)