Sitelet https://github.com/appium/python-client/pull/552/commits/e5e2493f187b16fa0749ce4ae74379ee835bb4a9
Skip to content
Merged
Changes from 1 commit
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
Next Next commit
chore: Add the workaround to avoid service freezes on Windows
  • Loading branch information
mykola-mokhnach committed Jul 15, 2020
commit e5e2493f187b16fa0749ce4ae74379ee835bb4a9
22 changes: 12 additions & 10 deletions appium/webdriver/appium_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -125,20 +125,20 @@ def start(self, **kwargs: Any) -> sp.Popen:

Keyword Args:
env (dict): Environment variables mapping. The default system environment,
which is inherited from the parent process is assigned by default.
which is inherited from the parent process, is assigned by default.
node (str): The full path to the main NodeJS executable. The service will try
to retrieve it automatically by default.
stdout (int): Check on the documentation for subprocess.Popen for more details.
The default value is subprocess.PIPE.
stderr (int): Check on the documentation for subprocess.Popen for more details.
The default value is subprocess.PIPE.
stdout (int): Check the documentation for subprocess.Popen for more details.
The default value is subprocess.DEVNULL on Windows and subprocess.PIPE on other platforms.
stderr (int): Check the documentation for subprocess.Popen for more details.
The default value is subprocess.DEVNULL on Windows and subprocess.PIPE on other platforms.
timeout_ms (int): The maximum time to wait until Appium process starts listening
for HTTP connections. If set to zero or a negative number then no wait will be applied.
60000 ms by default
60000 ms by default.
main_script (str): The full path to the main Appium executable
(usually located this is build/lib/main.js). If this is not set
(usually located at build/lib/main.js). If this is not set
then the service tries to detect the path automatically.
args (str): List of Appium arguments (all must be strings). Check on
args (str): List of Appium arguments (all must be strings). Check
https://appium.io/docs/en/writing-running-appium/server-args/ for more details
about possible arguments and their values.

Expand All @@ -150,8 +150,10 @@ def start(self, **kwargs: Any) -> sp.Popen:

env = kwargs['env'] if 'env' in kwargs else None
node = kwargs['node'] if 'node' in kwargs else self._get_node()
stdout = kwargs['stdout'] if 'stdout' in kwargs else sp.PIPE
stderr = kwargs['stderr'] if 'stderr' in kwargs else sp.PIPE
# A workaround for https://github.com/appium/python-client/issues/534
default_std = sp.DEVNULL if sys.platform == 'win32' else sp.PIPE
stdout = kwargs['stdout'] if 'stdout' in kwargs else default_std
stderr = kwargs['stderr'] if 'stderr' in kwargs else default_std
timeout_ms = int(kwargs['timeout_ms']) if 'timeout_ms' in kwargs else STARTUP_TIMEOUT_MS
main_script = kwargs['main_script'] if 'main_script' in kwargs else self._get_main_script()
args = [node, main_script]
Expand Down