runcppunittests doesn't handle hangs gracefully

RESOLVED FIXED in mozilla19

Status

defect
RESOLVED FIXED
7 years ago
5 years ago

People

(Reporter: ted, Assigned: ted)

Tracking

unspecified
mozilla19
Points:
---
Dependency tree / graph

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

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/mozilla-central/rev/3c17914da5d6
Status: ASSIGNED → RESOLVED
Closed: 7 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.