Skip to content

Commit 7e40032

Browse files
committed
tests: assumeutxo: accept final height from either chainstate
1 parent 5bd2010 commit 7e40032

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

test/functional/feature_assumeutxo.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,15 @@ def no_sync():
159159
self.connect_nodes(0, 1)
160160

161161
self.log.info(f"Ensuring snapshot chain syncs to tip. ({FINAL_HEIGHT})")
162-
wait_until_helper(lambda: n1.getchainstates()['snapshot']['blocks'] == FINAL_HEIGHT)
162+
163+
def check_for_final_height():
164+
chainstates = n1.getchainstates()
165+
# The background validation may have completed before we run our first
166+
# check, so accept a final blockheight from either chainstate type.
167+
cs = chainstates.get('snapshot') or chainstates.get('normal')
168+
return cs['blocks'] == FINAL_HEIGHT
169+
170+
wait_until_helper(check_for_final_height)
163171
self.sync_blocks(nodes=(n0, n1))
164172

165173
self.log.info("Ensuring background validation completes")

0 commit comments

Comments
 (0)