Skip to content

Commit fd6bb70

Browse files
committed
[qa] Improve sync_blocks error messages.
1 parent 87ab49e commit fd6bb70

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

qa/rpc-tests/test_framework/util.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -132,10 +132,12 @@ def sync_blocks(rpc_connections, *, wait=1, timeout=60):
132132
if tips == [tips[0]] * len(tips):
133133
return
134134
if heights == [heights[0]] * len(heights):
135-
raise AssertionError("Block sync failed: (Hashes don't match)")
135+
raise AssertionError("Block sync failed, mismatched block hashes:{}".format(
136+
"".join("\n {!r}".format(tip) for tip in tips)))
136137
timeout -= wait
137138
maxheight = max(heights)
138-
raise AssertionError("Block sync failed with heights: {}".format(heights))
139+
raise AssertionError("Block sync to height {} timed out:{}".format(
140+
maxheight, "".join("\n {!r}".format(tip) for tip in tips)))
139141

140142
def sync_chain(rpc_connections, *, wait=1, timeout=60):
141143
"""

0 commit comments

Comments
 (0)