Closed Bug 811370 Opened 12 years ago Closed 12 years ago

runcppunittests doesn't handle hangs gracefully

Categories

(Testing :: General, defect)

defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED
mozilla19

People

(Reporter: ted, Assigned: ted)

References

Details

Attachments

(1 file)

Currently if a C++ unit test hangs, runcppunittests will throw a Python error trying to log the return code, and that's it. It should at least kill the process and log an error saying that the test timed out. Ideally it'd kill the process in such a way that we get a stack, but we don't have that functionality in mozbase yet (bug 811320).
Apparently I had no idea how to use mozprocess. This gets rid of a warning about using .waitForFinish and uses .run()s timeout parameter to handle timeouts properly. I tested this by adding an intentional hang to a test, and it gets reported properly:
cppunittests TEST-UNEXPECTED-FAIL | signaling_unittests | timed out after 10 seconds
make: *** [check] Error 1
Attachment #681487 - Flags: review?(ahalberstadt)
Comment on attachment 681487 [details] [diff] [review]
runcppunittests doesn't handle hangs gracefully

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

This looks good
Attachment #681487 - Flags: review?(ahalberstadt) → review+
https://hg.mozilla.org/integration/mozilla-inbound/rev/3c17914da5d6
Assignee: nobody → ted
Status: NEW → ASSIGNED
https://hg.mozilla.org/mozilla-central/rev/3c17914da5d6
Status: ASSIGNED → RESOLVED
Closed: 12 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla19
Depends on: 994830
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: