Closed Bug 928328 Opened 11 years ago Closed 9 years ago

ensure calls to get process lists include all functionality of talos in mozprocess

Categories

(Testing :: Talos, defect)

defect
Not set
normal

Tracking

(Not tracked)

RESOLVED WORKSFORME

People

(Reporter: jmaher, Unassigned)

References

Details

from jhammel's comment in bug 923770

So we should be careful that 1. the resulting consolidated code is best and more generic than the two different parts and; 2.(IMHO) that the resultant code should live in mozbase (specifically, e.g. mozbase.pid). The code is close but doesn't entirely match:
``talos.utils``
http://hg.mozilla.org/build/talos/file/ed35a6799e25/talos/utils.py#l121
def _parse_ps():
"""parse the output of the ps command"""
# -> where are the tests?
def ps(arg='axwww'):
"""
python front-end to `ps`
http://en.wikipedia.org/wiki/Ps_%28Unix%29
"""
def is_running(pid, psarg='axwww'):
"""returns if a pid is running"""
def running_processes(name, psarg='axwww', defunct=False):
"""
returns a list of 2-tuples of running processes:
(pid, ['path/to/executable', 'args', '...'])
with the executable named `name`.
- defunct: whether to return defunct processes
"""
----
``mozprocess.pid``
# https://github.com/mozilla/mozbase/blob/master/mozprocess/mozprocess/pid.py#L21
def ps(arg=psarg):
"""
python front-end to `ps`
http://en.wikipedia.org/wiki/Ps_%28Unix%29
returns a list of process dicts based on the `ps` header
"""
# https://github.com/mozilla/mozbase/blob/master/mozprocess/mozprocess/pid.py#L42
def running_processes(name, psarg=psarg, defunct=True):
"""
returns a list of
{'PID': PID of process (int)
'command': command line of process (list)}
with the executable named `name`.
- defunct: whether to return defunct processes
"""
# https://github.com/mozilla/mozbase/blob/master/mozprocess/mozprocess/pid.py#L73
def get_pids(name):
"""Get all the pids matching name"""
This doesn't have to be done here, but should be done as a follow up.
Blocks: 923770
See Also: → 1194074
I think we removed that code with Bug 1194076, so we should be good now. everything process related we use either lives in mozbase (for the counters) or we use psutil.

Feel free to reopen if I misunderstood something here!
Status: NEW → RESOLVED
Closed: 9 years ago
Resolution: --- → WORKSFORME
You need to log in before you can comment on or make changes to this bug.