bug 825511 - use outputTimeout for runcppunittests.py. r=ahal
--- a/testing/runcppunittests.py
+++ b/testing/runcppunittests.py
@@ -15,17 +15,19 @@ log = mozlog.getLogger('cppunittests')
@contextmanager
def TemporaryDirectory():
tempdir = tempfile.mkdtemp()
yield tempdir
shutil.rmtree(tempdir)
class CPPUnitTests(object):
# Time (seconds) to wait for test process to complete
- TEST_PROC_TIMEOUT = 300
+ TEST_PROC_TIMEOUT = 1200
+ # Time (seconds) in which process will be killed if it produces no output.
+ TEST_PROC_NO_OUTPUT_TIMEOUT = 300
def run_one_test(self, prog, env, symbols_path=None):
"""
Run a single C++ unit test program.
Arguments:
* prog: The path to the test program to run.
* env: The environment to use for running the program.
@@ -37,17 +39,18 @@ class CPPUnitTests(object):
basename = os.path.basename(prog)
log.info("Running test %s", basename)
with TemporaryDirectory() as tempdir:
proc = mozprocess.ProcessHandler([prog],
cwd=tempdir,
env=env)
#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=CPPUnitTests.TEST_PROC_TIMEOUT)
+ proc.run(timeout=CPPUnitTests.TEST_PROC_TIMEOUT,
+ outputTimeout=CPPUnitTests.TEST_PROC_NO_OUTPUT_TIMEOUT)
proc.wait()
if proc.timedOut:
log.testFail("%s | timed out after %d seconds",
basename, CPPUnitTests.TEST_PROC_TIMEOUT)
return False
if mozcrash.check_for_crashes(tempdir, symbols_path,
test_name=basename):
log.testFail("%s | test crashed", basename)