Skip to content

Commit eb64611

Browse files
committed
Merge bitcoin/bitcoin#31383: test: Add missing node.setmocktime(self.mocktime) to p2p_ibd_stalling.py
faa16ed test: Add missing node.setmocktime(self.mocktime) to p2p_ibd_stalling.py (MarcoFalke) Pull request description: This was forgotten by myself in commit fa5b58e. This time, there is a diff to test, which fails on current master and passes with this pull request. ```diff diff --git a/src/net_processing.cpp b/src/net_processing.cpp index e503a68..16438ebd08 100644 --- a/src/net_processing.cpp +++ b/src/net_processing.cpp @@ -112,9 +112,9 @@ static_assert(MAX_BLOCKTXN_DEPTH <= MIN_BLOCKS_TO_KEEP, "MAX_BLOCKTXN_DEPTH too * want to make this a per-peer adaptive value at some point. */ static const unsigned int BLOCK_DOWNLOAD_WINDOW = 1024; /** Block download timeout base, expressed in multiples of the block interval (i.e. 10 min) */ -static constexpr double BLOCK_DOWNLOAD_TIMEOUT_BASE = 1; +static constexpr double BLOCK_DOWNLOAD_TIMEOUT_BASE = .05; // 30 sec /** Additional block download timeout per parallel downloading peer (i.e. 5 min) */ -static constexpr double BLOCK_DOWNLOAD_TIMEOUT_PER_PEER = 0.5; +static constexpr double BLOCK_DOWNLOAD_TIMEOUT_PER_PEER = 0.; /** Maximum number of headers to announce when relaying blocks with headers message.*/ static const unsigned int MAX_BLOCKS_TO_ANNOUNCE = 8; /** Minimum blocks required to signal NODE_NETWORK_LIMITED */ diff --git a/test/functional/p2p_ibd_stalling.py b/test/functional/p2p_ibd_stalling.py index fa07873..f8cdd8998c 100755 --- a/test/functional/p2p_ibd_stalling.py +++ b/test/functional/p2p_ibd_stalling.py @@ -82,6 +82,7 @@ class P2PIBDStallingTest(BitcoinTestFramework): # Need to wait until 1023 blocks are received - the magic total bytes number is a workaround in lack of an rpc # returning the number of downloaded (but not connected) blocks. bytes_recv = 172761 if not self.options.v2transport else 169692 + time.sleep(31); self.wait_until(lambda: self.total_bytes_recv_for_blocks() == bytes_recv) self.all_sync_send_with_ping(peers) ACKs for top commit: brunoerg: ACK faa16ed Tree-SHA512: 5a670e2dcf828ac83b721a3e20d897744cca50080b0583a8460a0d0c7bf2c2c988cf7e35f688dde6a3349f1c21cc83a16ea5242ed06a59d59a04130416690737
2 parents 6cd95de + faa16ed commit eb64611

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

test/functional/p2p_ibd_stalling.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,7 @@ def run_test(self):
7474

7575
self.log.info("Check that a staller does not get disconnected if the 1024 block lookahead buffer is filled")
7676
self.mocktime = int(time.time()) + 1
77+
node.setmocktime(self.mocktime)
7778
for id in range(NUM_PEERS):
7879
peers.append(node.add_outbound_p2p_connection(P2PStaller(stall_block), p2p_idx=id, connection_type="outbound-full-relay"))
7980
peers[-1].block_store = block_dict

0 commit comments

Comments
 (0)