зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1896106 - [marionette] Don't wait for reader thread when polling psutil process. r=webdriver-reviewers,jgraham
Differential Revision: https://phabricator.services.mozilla.com/D210031
This commit is contained in:
Родитель
74b5b31cb4
Коммит
1a8b134389
|
@ -211,12 +211,9 @@ class ProcessHandlerMixin(object):
|
|||
return self.returncode
|
||||
|
||||
@_has_valid_proc
|
||||
def poll(self, wait_reader=True):
|
||||
def poll(self):
|
||||
"""Check if child process has terminated
|
||||
|
||||
:param wait_reader: If set to True, it waits not only for the process
|
||||
to exit but also for all output to be fully read. (Defaults to True).
|
||||
|
||||
Returns the current returncode value:
|
||||
- None if the process hasn't terminated yet
|
||||
- A negative number if the process was killed by signal N (Unix only)
|
||||
|
@ -226,7 +223,10 @@ class ProcessHandlerMixin(object):
|
|||
if hasattr(self, "returncode"):
|
||||
return self.returncode
|
||||
|
||||
return self.wait(0, wait_reader=wait_reader)
|
||||
# If the process that is observed wasn't started with Popen there is
|
||||
# no `poll()` method available. Use `wait()` instead and do not wait
|
||||
# for the reader thread because it would cause extra delays.
|
||||
return self.wait(0, wait_reader=False)
|
||||
|
||||
def processOutput(self, timeout=None, outputTimeout=None):
|
||||
"""
|
||||
|
|
Загрузка…
Ссылка в новой задаче