aboutsummaryrefslogtreecommitdiff
path: root/binary_search_tool
diff options
context:
space:
mode:
authorCassidy Burden <cburden@google.com>2016-06-16 15:43:38 -0700
committerchrome-bot <chrome-bot@chromium.org>2016-06-17 11:39:39 -0700
commitb51148ca9f8b8a9a1322342836ac5906f2564f85 (patch)
treead95a4ab7a4bc5f4529c2ee2811ad71873d03f1a /binary_search_tool
parentdcafebee1897d69f20282dc52082e1e5602cdbf0 (diff)
downloadtoolchain-utils-b51148ca9f8b8a9a1322342836ac5906f2564f85.tar.gz
Fix binary search tool SaveState to correctly save bisecting logic
Previously SaveState wasn't saving the full program state. Now resuming can continue at the latest possible iteration. TEST=Unit tests run, tested with package bisector Change-Id: Id8542a61d16b4c3e18d696d0b601fbd0dd98d048 Reviewed-on: https://chrome-internal-review.googlesource.com/265096 Commit-Ready: Cassidy Burden <cburden@google.com> Tested-by: Cassidy Burden <cburden@google.com> Reviewed-by: Caroline Tice <cmtice@google.com> Reviewed-by: Han Shen <shenhan@google.com>
Diffstat (limited to 'binary_search_tool')
-rwxr-xr-xbinary_search_tool/binary_search_state.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/binary_search_tool/binary_search_state.py b/binary_search_tool/binary_search_state.py
index c26031b3..5b4ed9ed 100755
--- a/binary_search_tool/binary_search_state.py
+++ b/binary_search_tool/binary_search_state.py
@@ -244,8 +244,8 @@ class BinarySearchState(object):
self.bs.SetSortedList(self.all_items)
def SaveState(self):
- ce, l, bs = self.ce, self.l, self.bs
- self.ce, self.l, self.bs = None, None, None
+ ce, l = self.ce, self.l
+ self.ce, self.l, self.bs.logger = None, None, None
old_state = None
_, path = tempfile.mkstemp(prefix=HIDDEN_STATE_FILE, dir='.')
@@ -267,7 +267,7 @@ class BinarySearchState(object):
if old_state:
os.remove(old_state)
- self.ce, self.l, self.bs = ce, l, bs
+ self.ce, self.l, self.bs.logger = ce, l, l
@classmethod
def LoadState(cls):
@@ -277,7 +277,7 @@ class BinarySearchState(object):
bss = pickle.load(file(STATE_FILE))
bss.l = logger.GetLogger()
bss.ce = command_executer.GetCommandExecuter()
- bss.PopulateItemsUsingList(bss.all_items)
+ bss.bs.logger = bss.l
bss.resumed = True
binary_search_perforce.verbose = bss.verbose
return bss