Closed Bug 705220 Opened 13 years ago Closed 11 years ago

tests should be written for mozprocess.pid

Categories

(Testing :: Mozbase, defect)

defect
Not set
normal

Tracking

(Not tracked)

RESOLVED INCOMPLETE

People

(Reporter: k0scist, Unassigned)

Details

(Whiteboard: [mozbase])

Attachments

(1 file, 1 obsolete file)

While not necessarily good practice, Talos and other harnesses check
against the shelled-out command `ps` to see what processes is
running.  While not currently consumed (though see
https://bugzilla.mozilla.org/show_bug.cgi?id=700722 and
https://bugzilla.mozilla.org/show_bug.cgi?id=694625 ), the
`mozprocess.pid` module should have tests whereby various combinations
of processes are launched and then the functions appropriately
tested. (An is_running() function would also be nice.)
Whiteboard: [mozbase]
Attached patch Patch to resolve the bug. (obsolete) — Splinter Review
I have attached a patch with few test cases but it could very well be missing out something. Please review and apply if correct. Thanks :)
Comment on attachment 642747 [details] [diff] [review]
Patch to resolve the bug.

+    pids = get_pids(name)
+    if len(pids) > 0:
+        return True
+    else:
+        return False

This can just be return len(pids) > 0

We also shouldn't need the check_for_processes function at all
Updated the submitted patch.
Attachment #642747 - Attachment is obsolete: true
(In reply to swvist from comment #3)
> Created attachment 642758 [details] [diff] [review]
> Updated the patch
> 
> Updated the submitted patch.

Could you combine the two diffs into one single diff that has the new file, pidtest.py, but without the check_for_processes function? Thanks
This is probably not a priority and we are likely not to need it at all.  Please reopen/refile if desired
Status: NEW → RESOLVED
Closed: 11 years ago
Resolution: --- → INCOMPLETE
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: