Closed
Bug 1512686
Opened 6 years ago
Closed 6 years ago
[mozdevice] Use pidof to test for process existence / get pid
Categories
(Testing :: Mozbase, enhancement, P1)
Tracking
(firefox66 fixed)
RESOLVED
FIXED
mozilla66
Tracking | Status | |
---|---|---|
firefox66 | --- | fixed |
People
(Reporter: gbrown, Assigned: gbrown)
References
Details
Attachments
(1 file, 1 obsolete file)
(deleted),
patch
|
bc
:
review+
|
Details | Diff | Splinter Review |
No description provided.
Assignee | ||
Comment 1•6 years ago
|
||
Seems like it would be much more efficient than parsing ps output, when available.
Blocks: 1509324
Assignee | ||
Updated•6 years ago
|
Priority: -- → P1
Assignee | ||
Comment 2•6 years ago
|
||
In my testing, pidof is not available on the 4.3 emulator, but is available on all of our newer android versions.
https://treeherder.mozilla.org/#/jobs?repo=try&tier=1%2C2%2C3&revision=20c4becb37e5999405bb11fcd885c8008cbaa122
Attachment #9030051 -
Flags: review?(bob)
Comment 3•6 years ago
|
||
Comment on attachment 9030051 [details] [diff] [review]
use 'adb shell pidof <package>' to determine process existence, where available
Review of attachment 9030051 [details] [diff] [review]:
-----------------------------------------------------------------
I like the use of pidof. Didn't know about it!
What would you think of adding a helper method pidof that is basically the meat of your addition to pkill and then calling that in both places?
::: testing/mozbase/mozdevice/mozdevice/adb.py
@@ +2437,5 @@
> + pid_output = self.shell_output('pidof %s' % app, timeout=timeout)
> + except ADBError:
> + return False
> + re_pid = re.compile(r'^[0-9]+$')
> + match = re_pid.search(pid_output)
Won't this only match a single process id? If pidof returns more than one process id, won't this fail since it is anchored at the start and end?
Attachment #9030051 -
Flags: review?(bob)
Assignee | ||
Comment 4•6 years ago
|
||
Good idea - thanks.
https://treeherder.mozilla.org/#/jobs?repo=try&tier=1%2C2%2C3&revision=5c0291909b1e49ceaec04a5cbdc62d5770724100
Attachment #9030051 -
Attachment is obsolete: true
Attachment #9030599 -
Flags: review?(bob)
Comment 5•6 years ago
|
||
Comment on attachment 9030599 [details] [diff] [review]
use 'adb shell pidof <package>' to determine process existence, where available
Review of attachment 9030599 [details] [diff] [review]:
-----------------------------------------------------------------
Thanks!
Attachment #9030599 -
Flags: review?(bob) → review+
Pushed by gbrown@mozilla.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/e977d545d16a
Use pidof to determine android process pid, when available; r=bc
Comment 7•6 years ago
|
||
bugherder |
Status: NEW → RESOLVED
Closed: 6 years ago
status-firefox66:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla66
Assignee | ||
Updated•6 years ago
|
You need to log in
before you can comment on or make changes to this bug.
Description
•