bug 932349 - make Mochitest use kill_on_timeout=False and an onTimeout handler. r=jhammel

This commit is contained in:
Ted Mielczarek 2013-11-06 09:14:23 -05:00
parent 0e117f16fa
commit 3513b2c4a5

View File

@ -844,8 +844,14 @@ class Mochitest(MochitestUtilsMixin):
dump_screen_on_timeout=not debuggerInfo,
)
def timeoutHandler():
browserProcessId = outputHandler.browserProcessId
self.handleTimeout(timeout, proc, utilityPath, debuggerInfo, browserProcessId)
kp_kwargs = {'kill_on_timeout': False,
'onTimeout': [timeoutHandler]}
# if the output handler is a pipe, it will process output via the subprocess
kp_kwargs = {} if outputHandler.pipe else {'processOutputLine': [outputHandler]}
if not outputHandler.pipe:
kp_kwargs['processOutputLine'] = [outputHandler]
# create mozrunner instance and start the system under test process
self.lastTestSeen = self.test_name
@ -902,11 +908,6 @@ class Mochitest(MochitestUtilsMixin):
# finalize output handler
outputHandler.finish(didTimeout)
# handle timeout
if didTimeout:
browserProcessId = outputHandler.browserProcessId
self.handleTimeout(timeout, proc, utilityPath, debuggerInfo, browserProcessId)
# record post-test information
if status:
log.info("TEST-UNEXPECTED-FAIL | %s | application terminated with exit code %s", self.lastTestSeen, status)