test: Use same rpc timeout for authproxy and cli #33698

pull maflcko wants to merge 1 commits into bitcoin:master from maflcko:2510-test-cli-timeout-same changing 1 files +14 −6
  1. maflcko commented at 2:58 PM on October 24, 2025: member

    It seems odd to use different timeouts (and timeout factors) depending on whether the Python RPC proxy is used, or the bitcoin rpc command line interface.

    Fix it by using the same timeout.

    This can be tested by introducing a timeout error and checking it happens with and without --usecli after the exact same time.

    Example timeout error:

    diff --git a/test/functional/mining_template_verification.py b/test/functional/mining_template_verification.py
    index de0833c596..e0f93a2b1e 100755
    --- a/test/functional/mining_template_verification.py
    +++ b/test/functional/mining_template_verification.py
    @@ -173,7 +173,7 @@ class MiningTemplateVerificationTest(BitcoinTestFramework):
     
             self.log.info("Submitting this block should succeed")
             assert_equal(node.submitblock(block.serialize().hex()), None)
    -        node.waitforblockheight(2)
    +        node.waitforblockheight(200000)
     
         def transaction_test(self, node, block_0_height, tx):
             self.log.info("make block template with a transaction")
    

    Example cmd: ./bld-cmake/test/functional/mining_template_verification.py --timeout-factor=0.1 --usecli.

  2. test: Use same rpc timeout for authproxy and cli 66667d6512
  3. DrahtBot added the label Tests on Oct 24, 2025
  4. DrahtBot commented at 2:58 PM on October 24, 2025: contributor

    <!--e57a25ab6845829454e8d69fc972939a-->

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

    <!--006a51241073e994b41acfe9ec718e94-->

    Code Coverage & Benchmarks

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

    <!--021abf342d371248e50ceaed478a90ca-->

    Reviews

    See the guideline for information on the review process.

    Type Reviewers
    ACK brunoerg, stickies-v

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

    <!--5faf32d7da4f0f540f40219e4f7537a3-->

  5. Sammie05 commented at 12:04 AM on October 25, 2025: none

    Tested PR #33698 I went through the new changes, built the code, ran the specific test p2p_headers_sync_with_minchainwork.py --timeout-factor=0.2 in both RPC and CLI modes and everything looks good . but why did we decide on half the timeout for CLI instead of using the same value?

  6. maflcko commented at 12:22 PM on October 25, 2025: member

    I went through the new changes, built the code, ran the specific test p2p_headers_sync_with_minchainwork.py --timeout-factor=0.2 in both RPC and CLI modes and everything looks good .

    It shouldn't look "good". They should both timeout with the same timeout value.

    but why did we decide on half the timeout for CLI instead of using the same value?

    The goal of this pull is to use the exact same value, which is also what it does.

  7. brunoerg approved
  8. brunoerg commented at 3:54 PM on October 27, 2025: contributor

    ACK 66667d6512294fd5dd02161b7c68c19af0865865


    This can be tested by introducing a timeout error and checking it happens with and without --usecli after the exact same time.

    I tested it with the provided timeout error example and worked as expected. With this PR, timeout is quite the same with and without --use-cli. With master, they're very different and I ended up by interrupting the run after some long seconds without --usecli just in case.

    This PR:

    time ./build/test/functional/mining_template_verification.py --timeout-factor=0.1 --usecli
    2025-10-27T15:11:19.771212Z TestFramework (INFO): PRNG seed is: 5723465082132348369
    2025-10-27T15:11:19.771681Z TestFramework (INFO): Initializing test directory /var/folders/7j/m0yjzmhj4ys9jgl353v2mqph0000gq/T/bitcoin_func_test_pozrxv5c
    2025-10-27T15:11:20.123898Z TestFramework (INFO): Valid block
    2025-10-27T15:11:20.128439Z TestFramework (INFO): Bad input hash for coinbase transaction
    2025-10-27T15:11:20.137980Z TestFramework (INFO): Block with no transactions
    2025-10-27T15:11:20.147410Z TestFramework (INFO): Truncated final transaction
    2025-10-27T15:11:20.153225Z TestFramework (INFO): Duplicate transaction
    2025-10-27T15:11:20.162608Z TestFramework (INFO): Transaction that spends from thin air
    2025-10-27T15:11:20.171805Z TestFramework (INFO): Non-final transaction
    2025-10-27T15:11:20.181233Z TestFramework (INFO): Bad tx count
    2025-10-27T15:11:20.185630Z TestFramework (INFO): Extremely high nBits
    2025-10-27T15:11:20.194551Z TestFramework (INFO): Lowering nBits should make the block invalid
    2025-10-27T15:11:20.204060Z TestFramework (INFO): Bad merkle root
    2025-10-27T15:11:20.213258Z TestFramework (INFO): Bad timestamps
    2025-10-27T15:11:20.234411Z TestFramework (INFO): Block must build on the current tip
    2025-10-27T15:11:20.243550Z TestFramework (INFO): Generate a block
    2025-10-27T15:11:20.243745Z TestFramework (INFO): A block template doesn't need PoW
    2025-10-27T15:11:20.248469Z TestFramework (INFO): Add proof of work
    2025-10-27T15:11:20.252985Z TestFramework (INFO): getblocktemplate call in previous tests did not submit the block
    2025-10-27T15:11:20.257838Z TestFramework (INFO): Submitting this block should succeed
    2025-10-27T15:11:23.268741Z TestFramework (ERROR): Called Process failed with stdout='error: timeout on transient error: Could not connect to the server 127.0.0.1:18531 (error code 0 - "timeout reached")
    
    Make sure the bitcoind server is running and that you are connecting to the correct RPC port.
    Use "bitcoin-cli -help" for more info.
    '; stderr='None';
    Traceback (most recent call last):
      File "/Users/brunogarcia/projects/bitcoin-core-dev/test/functional/test_framework/test_framework.py", line 142, in main
        self.run_test()
        ~~~~~~~~~~~~~^^
      File "/Users/brunogarcia/projects/bitcoin-core-dev/./build/test/functional/mining_template_verification.py", line 312, in run_test
        self.submit_test(node, block_0_height, block_2)
        ~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "/Users/brunogarcia/projects/bitcoin-core-dev/./build/test/functional/mining_template_verification.py", line 198, in submit_test
        node.waitforblockheight(200000)
        ~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^
      File "/Users/brunogarcia/projects/bitcoin-core-dev/test/functional/test_framework/test_node.py", line 907, in __call__
        return self.cli.send_cli(self.command, *args, **kwargs)
               ~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "/Users/brunogarcia/projects/bitcoin-core-dev/test/functional/test_framework/test_node.py", line 992, in send_cli
        raise subprocess.CalledProcessError(returncode, p_args, output=cli_stderr)
    subprocess.CalledProcessError: Command '['/Users/brunogarcia/projects/bitcoin-core-dev/build/bin/bitcoin-cli', '-nonamed', '-datadir=/var/folders/7j/m0yjzmhj4ys9jgl353v2mqph0000gq/T/bitcoin_func_test_pozrxv5c/node0', '-rpcclienttimeout=3', 'waitforblockheight', '200000']' returned non-zero exit status 1.
    ...
    ./build/test/functional/mining_template_verification.py --timeout-factor=0.1   0.27s user 0.18s system 11% cpu 3.966 total
    
    ➜  bitcoin-core-dev git:(33698) ✗ time ./build/test/functional/mining_template_verification.py --timeout-factor=0.1
    2025-10-27T15:12:02.776857Z TestFramework (INFO): PRNG seed is: 5466641224519577849
    2025-10-27T15:12:02.777325Z TestFramework (INFO): Initializing test directory /var/folders/7j/m0yjzmhj4ys9jgl353v2mqph0000gq/T/bitcoin_func_test_8hof5ivk
    2025-10-27T15:12:03.068521Z TestFramework (INFO): Valid block
    2025-10-27T15:12:03.069022Z TestFramework (INFO): Bad input hash for coinbase transaction
    2025-10-27T15:12:03.069738Z TestFramework (INFO): Block with no transactions
    2025-10-27T15:12:03.070405Z TestFramework (INFO): Truncated final transaction
    2025-10-27T15:12:03.071279Z TestFramework (INFO): Duplicate transaction
    2025-10-27T15:12:03.071856Z TestFramework (INFO): Transaction that spends from thin air
    2025-10-27T15:12:03.072801Z TestFramework (INFO): Non-final transaction
    2025-10-27T15:12:03.073370Z TestFramework (INFO): Bad tx count
    2025-10-27T15:12:03.073657Z TestFramework (INFO): Extremely high nBits
    2025-10-27T15:12:03.074199Z TestFramework (INFO): Lowering nBits should make the block invalid
    2025-10-27T15:12:03.074730Z TestFramework (INFO): Bad merkle root
    2025-10-27T15:12:03.075252Z TestFramework (INFO): Bad timestamps
    2025-10-27T15:12:03.076494Z TestFramework (INFO): Block must build on the current tip
    2025-10-27T15:12:03.077043Z TestFramework (INFO): Generate a block
    2025-10-27T15:12:03.077104Z TestFramework (INFO): A block template doesn't need PoW
    2025-10-27T15:12:03.077403Z TestFramework (INFO): Add proof of work
    2025-10-27T15:12:03.077684Z TestFramework (INFO): getblocktemplate call in previous tests did not submit the block
    2025-10-27T15:12:03.077887Z TestFramework (INFO): Submitting this block should succeed
    2025-10-27T15:12:06.080008Z TestFramework (ERROR): Unexpected exception
    Traceback (most recent call last):
      File "/Users/brunogarcia/projects/bitcoin-core-dev/test/functional/test_framework/authproxy.py", line 174, in _get_response
        http_response = self.__conn.getresponse()
      File "/opt/homebrew/Cellar/python@3.13/3.13.2/Frameworks/Python.framework/Versions/3.13/lib/python3.13/http/client.py", line 1430, in getresponse
        response.begin()
        ~~~~~~~~~~~~~~^^
      File "/opt/homebrew/Cellar/python@3.13/3.13.2/Frameworks/Python.framework/Versions/3.13/lib/python3.13/http/client.py", line 331, in begin
        version, status, reason = self._read_status()
                                  ~~~~~~~~~~~~~~~~~^^
      File "/opt/homebrew/Cellar/python@3.13/3.13.2/Frameworks/Python.framework/Versions/3.13/lib/python3.13/http/client.py", line 292, in _read_status
        line = str(self.fp.readline(_MAXLINE + 1), "iso-8859-1")
                   ~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^
      File "/opt/homebrew/Cellar/python@3.13/3.13.2/Frameworks/Python.framework/Versions/3.13/lib/python3.13/socket.py", line 719, in readinto
        return self._sock.recv_into(b)
               ~~~~~~~~~~~~~~~~~~~~^^^
    TimeoutError: timed out
    
    During handling of the above exception, another exception occurred:
    
    Traceback (most recent call last):
      File "/Users/brunogarcia/projects/bitcoin-core-dev/test/functional/test_framework/test_framework.py", line 142, in main
        self.run_test()
        ~~~~~~~~~~~~~^^
      File "/Users/brunogarcia/projects/bitcoin-core-dev/./build/test/functional/mining_template_verification.py", line 312, in run_test
        self.submit_test(node, block_0_height, block_2)
        ~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "/Users/brunogarcia/projects/bitcoin-core-dev/./build/test/functional/mining_template_verification.py", line 198, in submit_test
        node.waitforblockheight(200000)
        ~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^
      File "/Users/brunogarcia/projects/bitcoin-core-dev/test/functional/test_framework/coverage.py", line 50, in __call__
        return_val = self.auth_service_proxy_instance.__call__(*args, **kwargs)
      File "/Users/brunogarcia/projects/bitcoin-core-dev/test/functional/test_framework/authproxy.py", line 137, in __call__
        response, status = self._request('POST', self.__url.path, postdata.encode('utf-8'))
                           ~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "/Users/brunogarcia/projects/bitcoin-core-dev/test/functional/test_framework/authproxy.py", line 111, in _request
        return self._get_response()
               ~~~~~~~~~~~~~~~~~~^^
      File "/Users/brunogarcia/projects/bitcoin-core-dev/test/functional/test_framework/authproxy.py", line 176, in _get_response
        raise JSONRPCException({
        ...<4 lines>...
                                              self.__conn.timeout)})
    test_framework.authproxy.JSONRPCException: 'waitforblockheight' RPC took longer than 3.000000 seconds. Consider using larger timeout for calls that take longer to return. (-344)
    2025-10-27T15:12:06.145763Z TestFramework (INFO): Not stopping nodes as test failed. The dangling processes will be cleaned up later.
    2025-10-27T15:12:06.145917Z TestFramework (WARNING): Not cleaning up dir /var/folders/7j/m0yjzmhj4ys9jgl353v2mqph0000gq/T/bitcoin_func_test_8hof5ivk
    2025-10-27T15:12:06.145966Z TestFramework (ERROR): Test failed. Test logging available at /var/folders/7j/m0yjzmhj4ys9jgl353v2mqph0000gq/T/bitcoin_func_test_8hof5ivk/test_framework.log
    2025-10-27T15:12:06.146096Z TestFramework (ERROR):
    2025-10-27T15:12:06.146248Z TestFramework (ERROR): Hint: Call /Users/brunogarcia/projects/bitcoin-core-dev/test/functional/combine_logs.py '/var/folders/7j/m0yjzmhj4ys9jgl353v2mqph0000gq/T/bitcoin_func_test_8hof5ivk' to consolidate all logs
    2025-10-27T15:12:06.146294Z TestFramework (ERROR):
    2025-10-27T15:12:06.146334Z TestFramework (ERROR): If this failure happened unexpectedly or intermittently, please file a bug and provide a link or upload of the combined log.
    2025-10-27T15:12:06.146399Z TestFramework (ERROR): https://github.com/bitcoin/bitcoin/issues
    2025-10-27T15:12:06.146433Z TestFramework (ERROR):
    [node 0] Cleaning up leftover process
    ./build/test/functional/mining_template_verification.py --timeout-factor=0.1  0.22s user 0.07s system 7% cpu 3.756 total
    

    master:

    I've interrupted after some time:

    ➜  bitcoin-core-dev git:(master) ✗ time ./build/test/functional/mining_template_verification.py --timeout-factor=0.1 --usecli
    2025-10-27T15:22:32.880207Z TestFramework (INFO): PRNG seed is: 1092200578974713961
    2025-10-27T15:22:32.880732Z TestFramework (INFO): Initializing test directory /var/folders/7j/m0yjzmhj4ys9jgl353v2mqph0000gq/T/bitcoin_func_test_e_yi4rfx
    2025-10-27T15:22:33.230171Z TestFramework (INFO): Valid block
    2025-10-27T15:22:33.234641Z TestFramework (INFO): Bad input hash for coinbase transaction
    2025-10-27T15:22:33.243711Z TestFramework (INFO): Block with no transactions
    2025-10-27T15:22:33.252973Z TestFramework (INFO): Truncated final transaction
    2025-10-27T15:22:33.258165Z TestFramework (INFO): Duplicate transaction
    2025-10-27T15:22:33.267783Z TestFramework (INFO): Transaction that spends from thin air
    2025-10-27T15:22:33.277660Z TestFramework (INFO): Non-final transaction
    2025-10-27T15:22:33.286685Z TestFramework (INFO): Bad tx count
    2025-10-27T15:22:33.291488Z TestFramework (INFO): Extremely high nBits
    2025-10-27T15:22:33.300580Z TestFramework (INFO): Lowering nBits should make the block invalid
    2025-10-27T15:22:33.310047Z TestFramework (INFO): Bad merkle root
    2025-10-27T15:22:33.319441Z TestFramework (INFO): Bad timestamps
    2025-10-27T15:22:33.338122Z TestFramework (INFO): Block must build on the current tip
    2025-10-27T15:22:33.347130Z TestFramework (INFO): Generate a block
    2025-10-27T15:22:33.347295Z TestFramework (INFO): A block template doesn't need PoW
    2025-10-27T15:22:33.351339Z TestFramework (INFO): Add proof of work
    2025-10-27T15:22:33.355839Z TestFramework (INFO): getblocktemplate call in previous tests did not submit the block
    2025-10-27T15:22:33.360846Z TestFramework (INFO): Submitting this block should succeed
    ^C2025-10-27T15:29:47.689592Z TestFramework (ERROR): Unexpected exception
    Traceback (most recent call last):
     File "/Users/brunogarcia/projects/bitcoin-core-dev/test/functional/test_framework/test_framework.py", line 142, in main
       self.run_test()
       ~~~~~~~~~~~~~^^
     File "/Users/brunogarcia/projects/bitcoin-core-dev/./build/test/functional/mining_template_verification.py", line 312, in run_test
       self.submit_test(node, block_0_height, block_2)
       ~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
     File "/Users/brunogarcia/projects/bitcoin-core-dev/./build/test/functional/mining_template_verification.py", line 198, in submit_test
       node.waitforblockheight(200000)
       ~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^
     File "/Users/brunogarcia/projects/bitcoin-core-dev/test/functional/test_framework/test_node.py", line 903, in __call__
       return self.cli.send_cli(self.command, *args, **kwargs)
              ~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
     File "/Users/brunogarcia/projects/bitcoin-core-dev/test/functional/test_framework/test_node.py", line 976, in send_cli
       cli_stdout, cli_stderr = process.communicate(input=stdin_data)
                                ~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^
     File "/opt/homebrew/Cellar/python@3.13/3.13.2/Frameworks/Python.framework/Versions/3.13/lib/python3.13/subprocess.py", line 1221, in communicate
       stdout, stderr = self._communicate(input, endtime, timeout)
                        ~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^
     File "/opt/homebrew/Cellar/python@3.13/3.13.2/Frameworks/Python.framework/Versions/3.13/lib/python3.13/subprocess.py", line 2130, in _communicate
       ready = selector.select(timeout)
     File "/opt/homebrew/Cellar/python@3.13/3.13.2/Frameworks/Python.framework/Versions/3.13/lib/python3.13/selectors.py", line 398, in select
       fd_event_list = self._selector.poll(timeout)
    KeyboardInterrupt
    2025-10-27T15:29:47.751786Z TestFramework (INFO): Not stopping nodes as test failed. The dangling processes will be cleaned up later.
    2025-10-27T15:29:47.751941Z TestFramework (WARNING): Not cleaning up dir /var/folders/7j/m0yjzmhj4ys9jgl353v2mqph0000gq/T/bitcoin_func_test_e_yi4rfx
    2025-10-27T15:29:47.751983Z TestFramework (ERROR): Test failed. Test logging available at /var/folders/7j/m0yjzmhj4ys9jgl353v2mqph0000gq/T/bitcoin_func_test_e_yi4rfx/test_framework.log
    2025-10-27T15:29:47.752100Z TestFramework (ERROR):
    2025-10-27T15:29:47.752208Z TestFramework (ERROR): Hint: Call /Users/brunogarcia/projects/bitcoin-core-dev/test/functional/combine_logs.py '/var/folders/7j/m0yjzmhj4ys9jgl353v2mqph0000gq/T/bitcoin_func_test_e_yi4rfx' to consolidate all logs
    2025-10-27T15:29:47.752233Z TestFramework (ERROR):
    2025-10-27T15:29:47.752261Z TestFramework (ERROR): If this failure happened unexpectedly or intermittently, please file a bug and provide a link or upload of the combined log.
    2025-10-27T15:29:47.752332Z TestFramework (ERROR): https://github.com/bitcoin/bitcoin/issues
    2025-10-27T15:29:47.752358Z TestFramework (ERROR):
    [node 0] Cleaning up leftover process
    ./build/test/functional/mining_template_verification.py --timeout-factor=0.1   0.55s user 0.42s system 0% cpu 7:15.28 total
    
    ➜  bitcoin-core-dev git:(master) ✗ time ./build/test/functional/mining_template_verification.py --timeout-factor=0.1
    2025-10-27T15:21:42.197156Z TestFramework (INFO): PRNG seed is: 270036072508533590
    2025-10-27T15:21:42.197649Z TestFramework (INFO): Initializing test directory /var/folders/7j/m0yjzmhj4ys9jgl353v2mqph0000gq/T/bitcoin_func_test_ecyhnza6
    2025-10-27T15:21:42.499371Z TestFramework (INFO): Valid block
    2025-10-27T15:21:42.499752Z TestFramework (INFO): Bad input hash for coinbase transaction
    2025-10-27T15:21:42.500380Z TestFramework (INFO): Block with no transactions
    2025-10-27T15:21:42.500912Z TestFramework (INFO): Truncated final transaction
    2025-10-27T15:21:42.502666Z TestFramework (INFO): Duplicate transaction
    2025-10-27T15:21:42.503447Z TestFramework (INFO): Transaction that spends from thin air
    2025-10-27T15:21:42.504407Z TestFramework (INFO): Non-final transaction
    2025-10-27T15:21:42.504941Z TestFramework (INFO): Bad tx count
    2025-10-27T15:21:42.505222Z TestFramework (INFO): Extremely high nBits
    2025-10-27T15:21:42.505694Z TestFramework (INFO): Lowering nBits should make the block invalid
    2025-10-27T15:21:42.506203Z TestFramework (INFO): Bad merkle root
    2025-10-27T15:21:42.506635Z TestFramework (INFO): Bad timestamps
    2025-10-27T15:21:42.507951Z TestFramework (INFO): Block must build on the current tip
    2025-10-27T15:21:42.508765Z TestFramework (INFO): Generate a block
    2025-10-27T15:21:42.508838Z TestFramework (INFO): A block template doesn't need PoW
    2025-10-27T15:21:42.509287Z TestFramework (INFO): Add proof of work
    2025-10-27T15:21:42.509694Z TestFramework (INFO): getblocktemplate call in previous tests did not submit the block
    2025-10-27T15:21:42.510011Z TestFramework (INFO): Submitting this block should succeed
    2025-10-27T15:21:45.511799Z TestFramework (ERROR): Unexpected exception
    Traceback (most recent call last):
      File "/Users/brunogarcia/projects/bitcoin-core-dev/test/functional/test_framework/authproxy.py", line 174, in _get_response
        http_response = self.__conn.getresponse()
      File "/opt/homebrew/Cellar/python@3.13/3.13.2/Frameworks/Python.framework/Versions/3.13/lib/python3.13/http/client.py", line 1430, in getresponse
        response.begin()
        ~~~~~~~~~~~~~~^^
      File "/opt/homebrew/Cellar/python@3.13/3.13.2/Frameworks/Python.framework/Versions/3.13/lib/python3.13/http/client.py", line 331, in begin
        version, status, reason = self._read_status()
                                  ~~~~~~~~~~~~~~~~~^^
      File "/opt/homebrew/Cellar/python@3.13/3.13.2/Frameworks/Python.framework/Versions/3.13/lib/python3.13/http/client.py", line 292, in _read_status
        line = str(self.fp.readline(_MAXLINE + 1), "iso-8859-1")
                   ~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^
      File "/opt/homebrew/Cellar/python@3.13/3.13.2/Frameworks/Python.framework/Versions/3.13/lib/python3.13/socket.py", line 719, in readinto
        return self._sock.recv_into(b)
               ~~~~~~~~~~~~~~~~~~~~^^^
    TimeoutError: timed out
    
    During handling of the above exception, another exception occurred:
    
    Traceback (most recent call last):
      File "/Users/brunogarcia/projects/bitcoin-core-dev/test/functional/test_framework/test_framework.py", line 142, in main
        self.run_test()
        ~~~~~~~~~~~~~^^
      File "/Users/brunogarcia/projects/bitcoin-core-dev/./build/test/functional/mining_template_verification.py", line 312, in run_test
        self.submit_test(node, block_0_height, block_2)
        ~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "/Users/brunogarcia/projects/bitcoin-core-dev/./build/test/functional/mining_template_verification.py", line 198, in submit_test
        node.waitforblockheight(200000)
        ~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^
      File "/Users/brunogarcia/projects/bitcoin-core-dev/test/functional/test_framework/coverage.py", line 50, in __call__
        return_val = self.auth_service_proxy_instance.__call__(*args, **kwargs)
      File "/Users/brunogarcia/projects/bitcoin-core-dev/test/functional/test_framework/authproxy.py", line 137, in __call__
        response, status = self._request('POST', self.__url.path, postdata.encode('utf-8'))
                           ~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "/Users/brunogarcia/projects/bitcoin-core-dev/test/functional/test_framework/authproxy.py", line 111, in _request
        return self._get_response()
               ~~~~~~~~~~~~~~~~~~^^
      File "/Users/brunogarcia/projects/bitcoin-core-dev/test/functional/test_framework/authproxy.py", line 176, in _get_response
        raise JSONRPCException({
        ...<4 lines>...
                                              self.__conn.timeout)})
    test_framework.authproxy.JSONRPCException: 'waitforblockheight' RPC took longer than 3.000000 seconds. Consider using larger timeout for calls that take longer to return. (-344)
    2025-10-27T15:21:45.567977Z TestFramework (INFO): Not stopping nodes as test failed. The dangling processes will be cleaned up later.
    2025-10-27T15:21:45.568097Z TestFramework (WARNING): Not cleaning up dir /var/folders/7j/m0yjzmhj4ys9jgl353v2mqph0000gq/T/bitcoin_func_test_ecyhnza6
    2025-10-27T15:21:45.568132Z TestFramework (ERROR): Test failed. Test logging available at /var/folders/7j/m0yjzmhj4ys9jgl353v2mqph0000gq/T/bitcoin_func_test_ecyhnza6/test_framework.log
    2025-10-27T15:21:45.568213Z TestFramework (ERROR):
    2025-10-27T15:21:45.568320Z TestFramework (ERROR): Hint: Call /Users/brunogarcia/projects/bitcoin-core-dev/test/functional/combine_logs.py '/var/folders/7j/m0yjzmhj4ys9jgl353v2mqph0000gq/T/bitcoin_func_test_ecyhnza6' to consolidate all logs
    2025-10-27T15:21:45.568347Z TestFramework (ERROR):
    2025-10-27T15:21:45.568370Z TestFramework (ERROR): If this failure happened unexpectedly or intermittently, please file a bug and provide a link or upload of the combined log.
    2025-10-27T15:21:45.568419Z TestFramework (ERROR): https://github.com/bitcoin/bitcoin/issues
    2025-10-27T15:21:45.568443Z TestFramework (ERROR):
    [node 0] Cleaning up leftover process
    ./build/test/functional/mining_template_verification.py --timeout-factor=0.1  0.21s user 0.08s system 7% cpu 3.793 total
    
  9. Sammie05 commented at 9:08 AM on October 28, 2025: none

    I went through the new changes, built the code, ran the specific test p2p_headers_sync_with_minchainwork.py --timeout-factor=0.2 in both RPC and CLI modes and everything looks good .

    It shouldn't look "good". They should both timeout with the same timeout value.

    but why did we decide on half the timeout for CLI instead of using the same value?

    The goal of this pull is to use the exact same value, which is also what it does.

    I went through the new changes, built the code, ran the specific test p2p_headers_sync_with_minchainwork.py --timeout-factor=0.2 in both RPC and CLI modes and everything looks good .

    It shouldn't look "good". They should both timeout with the same timeout value.

    but why did we decide on half the timeout for CLI instead of using the same value?

    The goal of this pull is to use the exact same value, which is also what it does.

    Thanks for clarifying! I understand the goal now.

    But looking at the code

    self.cli = TestNodeCLI( binaries, self.datadir_path, self.rpc_timeout // 2 )

    Doesn't the // 2 division mean CLI is actually getting half the RPC timeout instead of the same value?

  10. maflcko commented at 9:38 AM on October 28, 2025: member

    Doesn't the // 2 division mean CLI is actually getting half the RPC timeout instead of the same value?

    It is explained in the trailing comment, which refers to https://github.com/bitcoin/bitcoin/blob/66667d6512294fd5dd02161b7c68c19af0865865/test/functional/test_framework/test_node.py#L322

    If you have a question about a line of code, it is better to leave the question on the line of code, instead of in the general pull request thread.

  11. Sammie05 commented at 10:37 AM on October 28, 2025: none

    Doesn't the // 2 division mean CLI is actually getting half the RPC timeout instead of the same value?

    It is explained in the trailing comment, which refers to

    https://github.com/bitcoin/bitcoin/blob/66667d6512294fd5dd02161b7c68c19af0865865/test/functional/test_framework/test_node.py#L322

    If you have a question about a line of code, it is better to leave the question on the line of code, instead of in the general pull request thread.

    Alrighht.

  12. maflcko requested review from stickies-v on Oct 30, 2025
  13. stickies-v approved
  14. stickies-v commented at 3:52 PM on October 30, 2025: contributor

    tACK 66667d6512294fd5dd02161b7c68c19af0865865

    Rationale makes sense, tested old and new behaviour, code LGTM.

  15. fanquake merged this on Oct 30, 2025
  16. fanquake closed this on Oct 30, 2025

  17. maflcko deleted the branch on Oct 30, 2025

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: 2026-05-02 06:12 UTC

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