diff options
author | Cassidy Burden <cburden@google.com> | 2016-06-13 10:02:04 -0700 |
---|---|---|
committer | chrome-bot <chrome-bot@chromium.org> | 2016-06-13 13:24:45 -0700 |
commit | 333fe383dcd0c35981a5473bc913d07b52c310a1 (patch) | |
tree | d134deb650b2921bad0196b7abb998bcd725535f /binary_search_tool/binary_search_state.py | |
parent | acb7a1933e5e0834592d59fd00547a3926c0e880 (diff) | |
download | toolchain-utils-333fe383dcd0c35981a5473bc913d07b52c310a1.tar.gz |
Update bisection tool to use RunCommandWExceptionCleanup
Update all calls to RunCommand to RunCommandWExceptionCleanup so that
processes spawned by the bisection tool are properly cleaned up.
TEST=Ctrl-c properly kill cros flash
BUG=chromium:618461
Change-Id: I53871a911b723007d550876241129708b7ae2a92
Reviewed-on: https://chrome-internal-review.googlesource.com/264278
Commit-Ready: Cassidy Burden <cburden@google.com>
Tested-by: Cassidy Burden <cburden@google.com>
Reviewed-by: Caroline Tice <cmtice@google.com>
Diffstat (limited to 'binary_search_tool/binary_search_state.py')
-rwxr-xr-x | binary_search_tool/binary_search_state.py | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/binary_search_tool/binary_search_state.py b/binary_search_tool/binary_search_state.py index e6fe38e9..f43c37d5 100755 --- a/binary_search_tool/binary_search_state.py +++ b/binary_search_tool/binary_search_state.py @@ -104,19 +104,22 @@ class BinarySearchState(object): command = '%s %s' % (switch_script, temp_file) else: command = '%s %s' % (switch_script, ' '.join(item_list)) - ret = self.ce.RunCommand(command, print_to_console=self.verbose) + ret, _, _ = self.ce.RunCommandWExceptionCleanup( + command, print_to_console=self.verbose) assert ret == 0, 'Switch script %s returned %d' % (switch_script, ret) def TestScript(self): command = self.test_script - return self.ce.RunCommand(command) + ret, _, _ = self.ce.RunCommandWExceptionCleanup(command) + return ret def InstallScript(self): if not self.install_script: return 0 command = self.install_script - return self.ce.RunCommand(command) + ret, _, _ = self.ce.RunCommandWExceptionCleanup(command) + return ret def DoVerify(self): for _ in range(int(self.verify_level)): @@ -206,7 +209,9 @@ class BinarySearchState(object): def PopulateItemsUsingCommand(self, command): ce = command_executer.GetCommandExecuter() - _, out, _ = ce.RunCommandWOutput(command, print_to_console=self.verbose) + _, out, _ = ce.RunCommandWExceptionCleanup(command, + return_output=True, + print_to_console=self.verbose) all_items = out.split() self.PopulateItemsUsingList(all_items) |