Closed Bug 987372 Opened 10 years ago Closed 10 years ago

xpcshell process running httpd sometimes lingers

Categories

(Testing :: Mochitest, defect)

defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED
mozilla31

People

(Reporter: gps, Assigned: gps)

Details

Attachments

(1 file)

If you ctrl+c at the right moment during mochitest test startup, the xpcshell process running the httpd.js server lingers after the runtests.py process goes away. Subsequent test runs will hang due to unable to bind to the hard-coded port 8888.

I wonder if this can cause failures in automation?
The mochitest runner could start a child process but not clean it up in
all cases. This patch ensures we always try to stop child processes
before exiting.

Ideally, things should probably be implemented as context managers or
the cleanup logic should live in a __del__. But, perfect is the enemy of
done. This simple approach appears to solve the problem in a manner that
isn't too invasive.

I'm not sure how I would go about testing this, so I didn't write a
test. Local testing reveals the new code seems to work.
Attachment #8395959 - Flags: review?(ahalberstadt)
Assignee: nobody → gps
Status: NEW → ASSIGNED
Comment on attachment 8395959 [details] [diff] [review]
Try harder to stop child processes in mochitest runner

Review of attachment 8395959 [details] [diff] [review]:
-----------------------------------------------------------------

Lgtm, thanks. Yeah, I don't think trying to implement anything "properly" in mochitest is worthwhile at the moment. We are moving towards a world where re-writing it from scratch wouldn't be terribly hard and I've already started thinking about ways to do this (though finding the time is another matter).
Attachment #8395959 - Flags: review?(ahalberstadt) → review+
https://hg.mozilla.org/mozilla-central/rev/85d9111e4bb9
Status: ASSIGNED → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla31
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: