bug 811370 - runcppunittests doesn't handle hangs gracefully. r=ahal
authorTed Mielczarek <ted@mielczarek.org>
Wed, 14 Nov 2012 10:52:55 -0500
changeset 121167 3c17914da5d653bf750cdc19df9efab12f1ed093
parent 121166 b18ea5417903bd83e641c3a17199b3a3e2d6ded4
child 121168 414ca3fc8e99c75e369a1e6290123cc680bbf601
push id1997
push userakeybl@mozilla.com
push dateMon, 07 Jan 2013 21:25:26 +0000
treeherdermozilla-beta@4baf45cdcf21 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersahal
bugs811370
milestone19.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
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