diff options
author | navabi@google.com <navabi@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-08-02 21:08:06 +0000 |
---|---|---|
committer | navabi@google.com <navabi@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-08-02 21:08:06 +0000 |
commit | 4cf098c4680b5fe0f19ebdcb6e0aed7d555ecea7 (patch) | |
tree | 6f4116aa1808ee521cea91745f6f47b25edf2d85 /build | |
parent | 3fd1f03acf818fe852ef6f5ae70f01bed88e3623 (diff) | |
download | chromium_src-4cf098c4680b5fe0f19ebdcb6e0aed7d555ecea7.zip chromium_src-4cf098c4680b5fe0f19ebdcb6e0aed7d555ecea7.tar.gz chromium_src-4cf098c4680b5fe0f19ebdcb6e0aed7d555ecea7.tar.bz2 |
Put cleanup steps in finally block so cleanup happens after halt on failure.
The device_status_check hangs because there are still processes launched by the
buildbot script that are not cleaned up. E.g.
https://chromegw.corp.google.com/i/clank/builders/manta-sharded-official-perf-clankium/builds/2359
This makes sure the post commands are executed after halt on failure.
BUG=265578
Review URL: https://chromiumcodereview.appspot.com/21261006
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@215365 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'build')
-rwxr-xr-x | build/android/buildbot/bb_device_steps.py | 43 |
1 files changed, 20 insertions, 23 deletions
diff --git a/build/android/buildbot/bb_device_steps.py b/build/android/buildbot/bb_device_steps.py index a1b5f93..2f4b0c7 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__': |