Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(3080)

Unified Diff: build/android/buildbot/bb_device_steps.py

Issue 21261006: Put cleanup steps in finally block so cleanup happens after halt on failure. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebased. Created 7 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: build/android/buildbot/bb_device_steps.py
diff --git a/build/android/buildbot/bb_device_steps.py b/build/android/buildbot/bb_device_steps.py
index a1b5f93b262d4e9a2ddfa9620793326287d747db..2f4b0c7f89be1ab51399210edd70717cbd6b4c9f 100755
--- a/build/android/buildbot/bb_device_steps.py
+++ b/build/android/buildbot/bb_device_steps.py
@@ -306,34 +306,32 @@ def GenerateTestReport(options):
os.remove(report)
-def GetPostTestStepCmds():
- return [
- ('logcat_dump', LogcatDump),
- ('test_report', GenerateTestReport)
- ]
-
-
def MainTestWrapper(options):
- # Spawn logcat monitor
- SpawnLogcatMonitor()
+ try:
+ # Spawn logcat monitor
+ SpawnLogcatMonitor()
- # Run all device setup steps
- for _, cmd in GetDeviceSetupStepCmds():
- cmd(options)
+ # Run all device setup steps
+ for _, cmd in GetDeviceSetupStepCmds():
+ cmd(options)
- if options.install:
- test_obj = INSTRUMENTATION_TESTS[options.install]
- InstallApk(options, test_obj, print_step=True)
+ if options.install:
+ test_obj = INSTRUMENTATION_TESTS[options.install]
+ InstallApk(options, test_obj, print_step=True)
- if options.test_filter:
- bb_utils.RunSteps(options.test_filter, GetTestStepCmds(), options)
+ if options.test_filter:
+ bb_utils.RunSteps(options.test_filter, GetTestStepCmds(), options)
- if options.experimental:
- RunTestSuites(options, gtest_config.EXPERIMENTAL_TEST_SUITES)
+ if options.experimental:
+ RunTestSuites(options, gtest_config.EXPERIMENTAL_TEST_SUITES)
- # Run all post test steps
- for _, cmd in GetPostTestStepCmds():
- cmd(options)
+ finally:
+ # Run all post test steps
+ LogcatDump(options)
+ GenerateTestReport(options)
+ # KillHostHeartbeat() has logic to check if heartbeat process is running,
+ # and kills only if it finds the process is running on the host.
+ provision_devices.KillHostHeartbeat()
def GetDeviceStepsOptParser():
@@ -377,7 +375,6 @@ def main(argv):
setattr(options, 'target', options.factory_properties.get('target', 'Debug'))
MainTestWrapper(options)
- provision_devices.KillHostHeartbeat()
if __name__ == '__main__':
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698