[mozprocess] mozprocess wait(timeout) differs from py3 subprocess wait(timeout)
Categories
(Testing :: Mozbase, defect)
Tracking
(Not tracked)
People
(Reporter: gbrown, Unassigned)
References
Details
The wait() function in the mozprocess api handles its timeout parameter differently from the standard python process wait() in subprocess (but note in fairness that wait()'s timeout parameter was added in python 3.3).
subprocess docs for wait() say:
Popen.wait(timeout=None)
Wait for child process to terminate. Set and return returncode attribute.
If the process does not terminate after timeout seconds, raise a TimeoutExpired exception. It is safe to catch this exception and retry the wait.
For Posix systems with ignore-children, mozprocess wait() ignores the timeout:
https://searchfox.org/mozilla-central/rev/62ddcc03195036b355cb23b6f2e2b88d3f8099ad/testing/mozbase/mozprocess/mozprocess/processhandler.py#827
For Windows, mozprocess wait() respects the timeout, but does not throw TimeoutException and also kills the process:
https://searchfox.org/mozilla-central/rev/62ddcc03195036b355cb23b6f2e2b88d3f8099ad/testing/mozbase/mozprocess/mozprocess/processhandler.py#744-752
![]() |
Reporter | |
Updated•3 years ago
|
Comment 1•5 months ago
|
||
Note bug 1906191 changed what happens on timeout, making Posix and Windows systems consistent. It still doesn't throw TimeoutException, though.
Description
•