test: Add missing node.setmocktime(self.mocktime) to p2p_ibd_stalling.py #31383

pull maflcko wants to merge 1 commits into bitcoin:master from maflcko:2411-test-mock changing 1 files +1 −0
  1. maflcko commented at 1:30 pm on November 27, 2024: member

    This was forgotten by myself in commit fa5b58ea01fac1adb6336b8b6b5217193295c695.

    This time, there is a diff to test, which fails on current master and passes with this pull request.

     0diff --git a/src/net_processing.cpp b/src/net_processing.cpp
     1index e503a68382..16438ebd08 100644
     2--- a/src/net_processing.cpp
     3+++ b/src/net_processing.cpp
     4@@ -112,9 +112,9 @@ static_assert(MAX_BLOCKTXN_DEPTH <= MIN_BLOCKS_TO_KEEP, "MAX_BLOCKTXN_DEPTH too
     5  *  want to make this a per-peer adaptive value at some point. */
     6 static const unsigned int BLOCK_DOWNLOAD_WINDOW = 1024;
     7 /** Block download timeout base, expressed in multiples of the block interval (i.e. 10 min) */
     8-static constexpr double BLOCK_DOWNLOAD_TIMEOUT_BASE = 1;
     9+static constexpr double BLOCK_DOWNLOAD_TIMEOUT_BASE = .05; // 30 sec
    10 /** Additional block download timeout per parallel downloading peer (i.e. 5 min) */
    11-static constexpr double BLOCK_DOWNLOAD_TIMEOUT_PER_PEER = 0.5;
    12+static constexpr double BLOCK_DOWNLOAD_TIMEOUT_PER_PEER = 0.;
    13 /** Maximum number of headers to announce when relaying blocks with headers message.*/
    14 static const unsigned int MAX_BLOCKS_TO_ANNOUNCE = 8;
    15 /** Minimum blocks required to signal NODE_NETWORK_LIMITED */
    16diff --git a/test/functional/p2p_ibd_stalling.py b/test/functional/p2p_ibd_stalling.py
    17index fa07873929..f8cdd8998c 100755
    18--- a/test/functional/p2p_ibd_stalling.py
    19+++ b/test/functional/p2p_ibd_stalling.py
    20@@ -82,6 +82,7 @@ class P2PIBDStallingTest(BitcoinTestFramework):
    21         # Need to wait until 1023 blocks are received - the magic total bytes number is a workaround in lack of an rpc
    22         # returning the number of downloaded (but not connected) blocks.
    23         bytes_recv = 172761 if not self.options.v2transport else 169692
    24+        time.sleep(31);
    25         self.wait_until(lambda: self.total_bytes_recv_for_blocks() == bytes_recv)
    26 
    27         self.all_sync_send_with_ping(peers)
    
  2. test: Add missing node.setmocktime(self.mocktime) to p2p_ibd_stalling.py
    This was forgotten by myself in commit fa5b58ea01fac1adb6336b8b6b5217193295c695
    faa16ed4b9
  3. DrahtBot commented at 1:31 pm on November 27, 2024: contributor

    The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.

    Code Coverage & Benchmarks

    For details see: https://corecheck.dev/bitcoin/bitcoin/pulls/31383.

    Reviews

    See the guideline for information on the review process.

    Type Reviewers
    ACK brunoerg

    If your review is incorrectly listed, please react with 👎 to this comment and the bot will ignore it on the next update.

  4. DrahtBot added the label Tests on Nov 27, 2024
  5. brunoerg approved
  6. brunoerg commented at 1:25 pm on November 28, 2024: contributor

    ACK faa16ed4b9edd126b5a2b0c13994f18273096efc

    I verified the failure on master as expected:

     02024-11-28T13:09:43.140000Z TestFramework (INFO): Check that a staller does not get disconnected if the 1024 block lookahead buffer is filled
     12024-11-28T13:11:14.795000Z TestFramework.utils (ERROR): wait_until() failed. Predicate: ''''
     2        self.wait_until(lambda: self.total_bytes_recv_for_blocks() == bytes_recv)
     3'''
     42024-11-28T13:11:14.795000Z TestFramework (ERROR): Assertion failed
     5Traceback (most recent call last):
     6  File "/Users/brunogarcia/projects/bitcoin-core-dev/test/functional/test_framework/test_framework.py", line 132, in main
     7    self.run_test()
     8  File "/Users/brunogarcia/projects/bitcoin-core-dev/./build/test/functional/p2p_ibd_stalling.py", line 87, in run_test
     9    self.wait_until(lambda: self.total_bytes_recv_for_blocks() == bytes_recv)
    10  File "/Users/brunogarcia/projects/bitcoin-core-dev/test/functional/test_framework/test_framework.py", line 791, in wait_until
    11    return wait_until_helper_internal(test_function, timeout=timeout, timeout_factor=self.options.timeout_factor, check_interval=check_interval)
    12  File "/Users/brunogarcia/projects/bitcoin-core-dev/test/functional/test_framework/util.py", line 317, in wait_until_helper_internal
    13    raise AssertionError("Predicate {} not true after {} seconds".format(predicate_source, timeout))
    14AssertionError: Predicate ''''
    15        self.wait_until(lambda: self.total_bytes_recv_for_blocks() == bytes_recv)
    16''' not true after 60 seconds
    
  7. fanquake merged this on Dec 2, 2024
  8. fanquake closed this on Dec 2, 2024

  9. maflcko deleted the branch on Dec 2, 2024

github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2024-12-03 18:12 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me