Open Bug 1697308 Opened 4 years ago Updated 5 months ago

[mozprocess] mozprocess wait(timeout) differs from py3 subprocess wait(timeout)

Categories

(Testing :: Mozbase, defect)

Firefox 81
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

See Also: → 1683177
See Also: → 1705385
Severity: -- → S4

Note bug 1906191 changed what happens on timeout, making Posix and Windows systems consistent. It still doesn't throw TimeoutException, though.

You need to log in before you can comment on or make changes to this bug.