Skip to content

Commit

Permalink
[qa] Fix stale data bug in test_compactblocks_not_at_tip
Browse files Browse the repository at this point in the history
Clear test_node.last_block before requesting blocks in the
compactblocks_not_at_tip test so comparisons won't fail if a blocks were received
before the test started.

The bug doesn't currently cause any problems due to the order tests run, but
this will change in the next commit.
  • Loading branch information
ryanofsky committed Nov 2, 2016
1 parent 47e9659 commit 55bfddc
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions qa/rpc-tests/p2p-compactblocks.py
Expand Up @@ -648,6 +648,8 @@ def test_compactblocks_not_at_tip(self, node, test_node):
node.generate(1)
wait_until(test_node.received_block_announcement, timeout=30)
test_node.clear_block_announcement()
with mininode_lock:
test_node.last_block = None
test_node.send_message(msg_getdata([CInv(4, int(new_blocks[0], 16))]))
success = wait_until(lambda: test_node.last_block is not None, timeout=30)
assert(success)
Expand Down

0 comments on commit 55bfddc

Please sign in to comment.