Closed Bug 1843380 Opened 3 years ago Closed 3 years ago

[mozprocess] Add a simple subprocess wrapper for the most common mozprocess use case

Categories

(Testing :: Mozbase, enhancement)

Default
enhancement

Tracking

(firefox118 fixed)

RESOLVED FIXED
118 Branch
Tracking Status
firefox118 --- fixed

People

(Reporter: gbrown, Assigned: gbrown)

References

Details

Attachments

(1 file)

In bug 1839262 I replaced mozprocess with subprocess, but also needed a few dozen lines of code for:

  • convenient output handling
  • process timeout
  • output timeout.

Looking ahead at other mozprocess uses, this seems like a common pattern; let's add a new function to mozprocess that relies only on subprocess and core python (no ProcessHandler or os-specific code) to

  • execute a process
  • collect output
  • wait for completion
  • break and notify if the process is still running after <proc-timeout> seconds
  • break and notify if no new output is seen after <output-timeout> seconds.
Pushed by gbrown@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/4c688696d201 Implement mozprocess.run_and_wait r=hneiva
Status: NEW → RESOLVED
Closed: 3 years ago
Resolution: --- → FIXED
Target Milestone: --- → 118 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: