From 2ba86745f123f05adfa02fdff750773d3ed44b56 Mon Sep 17 00:00:00 2001 From: MarcoFalke Date: Sat, 20 Oct 2018 03:15:10 -0300 Subject: [PATCH] Merge #14456: test: forward timeouts properly in send_blocks_and_test Summary: 94e21c1501 test: forward timeouts properly in send_blocks_and_test (James O'Beirne) Pull request description: Small change motivated by frustrations while writing `feature_block` tests; when a timeout is passed to `send_blocks_and_test` it isn't forwarded onto constituent waiting calls - you can end up waiting 60 seconds when you articulated e.g. 5. Respect the given timeout all the way down. Tree-SHA512: 3a964764fc5e3431ae3b17bd642a27a1bd4526541a799ef63696c9dab0289a005a13d645770be6e46ea262d22a58f79d2b407293a39397b036f616fe20c21241 Backport of Core [[https://github.com/bitcoin/bitcoin/pull/14456 | PR14456]] Test Plan: ``` test_runner.py ``` Reviewers: #bitcoin_abc, Fabien Reviewed By: #bitcoin_abc, Fabien Differential Revision: https://reviews.bitcoinabc.org/D5821 --- test/functional/test_framework/mininode.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/functional/test_framework/mininode.py b/test/functional/test_framework/mininode.py index e422979f43..3558fbbc25 100755 --- a/test/functional/test_framework/mininode.py +++ b/test/functional/test_framework/mininode.py @@ -598,9 +598,9 @@ def send_blocks_and_test(self, blocks, node, *, success=True, request_block=True lambda: blocks[-1].sha256 in self.getdata_requests, timeout=timeout, lock=mininode_lock) if expect_disconnect: - self.wait_for_disconnect() + self.wait_for_disconnect(timeout=timeout) else: - self.sync_with_ping() + self.sync_with_ping(timeout=timeout) if success: wait_until(lambda: node.getbestblockhash()