bug 811370 - runcppunittests doesn't handle hangs gracefully. r=ahal
authorTed Mielczarek <ted@mielczarek.org>
Wed, 14 Nov 2012 10:52:55 -0500
changeset 113232 3c17914da5d653bf750cdc19df9efab12f1ed093
parent 113231 b18ea5417903bd83e641c3a17199b3a3e2d6ded4
child 113233 414ca3fc8e99c75e369a1e6290123cc680bbf601
push idunknown
push userunknown
push dateunknown
reviewersahal
bugs811370
milestone19.0a1
bug 811370 - runcppunittests doesn't handle hangs gracefully. r=ahal
testing/runcppunittests.py
--- a/testing/runcppunittests.py
+++ b/testing/runcppunittests.py
@@ -30,24 +30,21 @@ def run_one_test(prog, env, symbols_path
     Return True if the program exits with a zero status, False otherwise.
     """
     basename = os.path.basename(prog)
     log.info("Running test %s", basename)
     with TemporaryDirectory() as tempdir:
         proc = mozprocess.ProcessHandler([prog],
                                          cwd=tempdir,
                                          env=env)
-        proc.run()
         timeout = 300
-        proc.processOutput(timeout=timeout)
-        if proc.timedOut:
-            log.testFail("%s | timed out after %d seconds",
-                         basename, timeout)
-            return False
-        proc.waitForFinish(timeout=timeout)
+        #TODO: After bug 811320 is fixed, don't let .run() kill the process,
+        # instead use a timeout in .wait() and then kill to get a stack.
+        proc.run(timeout=timeout)
+        proc.wait()
         if proc.timedOut:
             log.testFail("%s | timed out after %d seconds",
                          basename, timeout)
             return False
         if mozcrash.check_for_crashes(tempdir, symbols_path,
                                       test_name=basename):
             log.testFail("%s | test crashed", basename)
             return False