aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSuhas Daftuar <sdaftuar@chaincode.com>2016-09-30 20:54:30 -0400
committerMarcoFalke <falke.marco@gmail.com>2016-10-03 10:57:40 +0200
commit624a007f476027457b32e0bd42584e67bb003317 (patch)
treedba395d4154f91289174c36c96395e470e05d953
parent3e4abb5025f4b7415fa57d576efebe1d45fd204e (diff)
downloadbitcoin-624a007f476027457b32e0bd42584e67bb003317.tar.xz
[qa] Fix race condition in p2p-compactblocks test
Also fix a bug in the sync_with_ping() helper function Github-Pull: #8854 Rebased-From: b5fd666984fdb7125cb809c773b36034f32128cc
-rwxr-xr-xqa/rpc-tests/p2p-compactblocks.py2
-rwxr-xr-xqa/rpc-tests/test_framework/mininode.py2
2 files changed, 3 insertions, 1 deletions
diff --git a/qa/rpc-tests/p2p-compactblocks.py b/qa/rpc-tests/p2p-compactblocks.py
index bf4fb43add..ac4655a841 100755
--- a/qa/rpc-tests/p2p-compactblocks.py
+++ b/qa/rpc-tests/p2p-compactblocks.py
@@ -237,6 +237,8 @@ class CompactBlocksTest(BitcoinTestFramework):
for i in range(num_transactions):
self.nodes[0].sendtoaddress(address, 0.1)
+ self.test_node.sync_with_ping()
+
# Now mine a block, and look at the resulting compact block.
self.test_node.clear_block_announcement()
block_hash = int(self.nodes[0].generate(1)[0], 16)
diff --git a/qa/rpc-tests/test_framework/mininode.py b/qa/rpc-tests/test_framework/mininode.py
index caffab3535..0b7b17cdb5 100755
--- a/qa/rpc-tests/test_framework/mininode.py
+++ b/qa/rpc-tests/test_framework/mininode.py
@@ -1536,7 +1536,7 @@ class SingleNodeConnCB(NodeConnCB):
def received_pong():
return (self.last_pong.nonce == self.ping_counter)
self.send_message(msg_ping(nonce=self.ping_counter))
- success = wait_until(received_pong, timeout)
+ success = wait_until(received_pong, timeout=timeout)
self.ping_counter += 1
return success