Skip to content

Commit 7abb363

Browse files
author
andreilukashevich
committed
add timeout for server stop as method param
1 parent 9cdfe5c commit 7abb363

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

appium/webdriver/appium_service.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -222,20 +222,23 @@ def start(self, **kwargs: Any) -> sp.Popen:
222222
raise AppiumServiceError(error_msg)
223223
return self._process
224224

225-
def stop(self) -> bool:
225+
def stop(self, timeout: int = 5) -> bool:
226226
"""Stops Appium service if it is running.
227227
228228
The call will be ignored if the service is not running
229229
or has been already stopped.
230230
231+
Args:
232+
timeout: timeout for process termination
233+
231234
Returns:
232235
`True` if the service was running before being stopped
233236
"""
234237
is_terminated = False
235238
if self.is_running:
236239
assert self._process
237240
self._process.terminate()
238-
self._process.communicate(timeout=5)
241+
self._process.communicate(timeout=timeout)
239242
is_terminated = True
240243
self._process = None
241244
self._cmd = None

0 commit comments

Comments
 (0)