本文整理汇总了Python中mozprocess.ProcessHandler.onTimeout方法的典型用法代码示例。如果您正苦于以下问题:Python ProcessHandler.onTimeout方法的具体用法?Python ProcessHandler.onTimeout怎么用?Python ProcessHandler.onTimeout使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类mozprocess.ProcessHandler
的用法示例。
在下文中一共展示了ProcessHandler.onTimeout方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: run_tests
# 需要导入模块: from mozprocess import ProcessHandler [as 别名]
# 或者: from mozprocess.ProcessHandler import onTimeout [as 别名]
def run_tests(self):
"""
Run the tests using runtests.py
"""
# Unfortunately, we can't use --close-when-done on single tests, so just run all of
# Harness_sanity and parse out the relevant data.Can change this when Bug 508664
# is resolved, as it will allow us to close single tests.
runtests_location = os.path.join(self.test_path, 'mochitest', 'runtests.py')
profile_location = os.path.join(self.test_path, 'mochitest', 'profile_path')
try:
shutil.rmtree(temp_dir_path)
except:
pass
extra_args = '--repeat=%s'
harness = 'Harness_sanity'
extra_profile_file = os.path.join(self.util_path, 'plugins')
def timeout_log():
print "Timed out"
proc = ProcessHandler(['python',
runtests_location,
'--profile-path=%s' % profile_location,
'--test-path=%s' % harness,
extra_args % PLAIN_REPEATS,
'--certificate-path=%s' % self.cert_path,
'--utility-path=%s' % self.util_path,
'--appname=%s' % self.app_name,
'--log-file=%s' % self.plain_log_file,
'--extra-profile-file=%s' % extra_profile_file,
'--close-when-done',
'--autorun'
])
proc.onTimeout = timeout_log
proc.waitForFinish(timeout=3600, logfile=os.path.join(self.log_dir, "profiler_log_%s" % self.builddata['timestamp']))
for test_path in CHROME_TESTS:
proc = ProcessHandler(['python',
runtests_location,
'--profile-path=%s' % profile_location,
'--chrome',
'--test-path=%s' % test_path,
extra_args % CHROME_REPEATS,
'--certificate-path=%s' % self.cert_path,
'--utility-path=%s' % self.util_path,
'--appname=%s' % self.app_name,
'--log-file=%s' % self.chrome_log_file,
'--close-when-done',
'--autorun'
])
proc.onTimeout = timeout_log
proc.waitForFinish(timeout=3600, logfile=os.path.join(self.log_dir, "profiler_log_%s" % self.builddata['timestamp']))
self.log.info("Done running tests")