bug 811370 - runcppunittests doesn't handle hangs gracefully. r=ahal

This commit is contained in:
Ted Mielczarek
2012-11-14 10:52:55 -05:00
parent 4182432162
commit 3d8a935069

View File

@@ -35,14 +35,11 @@ def run_one_test(prog, env, symbols_path=None):
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)