diff options
| author | MarcoFalke <[email protected]> | 2018-06-30 22:09:09 -1100 |
|---|---|---|
| committer | MarcoFalke <[email protected]> | 2018-06-30 22:09:11 -1100 |
| commit | 686e97a0c7358291d628213447cf33e99cde7ce8 (patch) | |
| tree | ad11a86f404f7e8fb144086bf44ae0da8ce1c488 | |
| parent | Merge #13431: validation: count blocks correctly for check level < 3 (diff) | |
| parent | [tests] Fix p2p_sendheaders race (diff) | |
| download | discoin-686e97a0c7358291d628213447cf33e99cde7ce8.tar.xz discoin-686e97a0c7358291d628213447cf33e99cde7ce8.zip | |
Merge #13522: [tests] Fix p2p_sendheaders race
75848bcf40 [tests] Fix p2p_sendheaders race (John Newbery)
Pull request description:
p2p_sendheaders has a race in part 1.3.
part 1.2 sends a block to the node over the 'test_node' connection, but
doesn't wait for an inv to be received on the 'inv_node' connection. If
we get to part 1.3 before that inv has been received, then the
subsequent call to check_last_inv_announcement could fail.
Tree-SHA512: ba9baffb3a9c0d379259190c737a7a4ad2e1133005a5b026af4f6b67a2978e24db39289551ad29134151879593ef5472be7e569a3557c0740fb51f5c56263d9a
| -rwxr-xr-x | test/functional/p2p_sendheaders.py | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/test/functional/p2p_sendheaders.py b/test/functional/p2p_sendheaders.py index d40b6af2e..2788d8995 100755 --- a/test/functional/p2p_sendheaders.py +++ b/test/functional/p2p_sendheaders.py @@ -301,6 +301,7 @@ class SendHeadersTest(BitcoinTestFramework): test_node.clear_block_announcements() # since we requested headers... elif i == 2: # this time announce own block via headers + inv_node.clear_block_announcements() height = self.nodes[0].getblockcount() last_time = self.nodes[0].getblock(self.nodes[0].getbestblockhash())['time'] block_time = last_time + 1 @@ -310,6 +311,7 @@ class SendHeadersTest(BitcoinTestFramework): test_node.wait_for_getdata([new_block.sha256]) test_node.send_message(msg_block(new_block)) test_node.sync_with_ping() # make sure this block is processed + wait_until(lambda: inv_node.block_announced, timeout=60, lock=mininode_lock) inv_node.clear_block_announcements() test_node.clear_block_announcements() |