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:

     0diff --git a/test/functional/mining_template_verification.py b/test/functional/mining_template_verification.py
     1index de0833c596..e0f93a2b1e 100755
     2--- a/test/functional/mining_template_verification.py
     3+++ b/test/functional/mining_template_verification.py
     4@@ -173,7 +173,7 @@ class MiningTemplateVerificationTest(BitcoinTestFramework):
     5 
     6         self.log.info("Submitting this block should succeed")
     7         assert_equal(node.submitblock(block.serialize().hex()), None)
     8-        node.waitforblockheight(2)
     9+        node.waitforblockheight(200000)
    10 
    11     def transaction_test(self, node, block_0_height, tx):
    12         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

    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/33698.

    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.

  5. Sammie05 commented at 0: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:

     0time ./build/test/functional/mining_template_verification.py --timeout-factor=0.1 --usecli
     12025-10-27T15:11:19.771212Z TestFramework (INFO): PRNG seed is: 5723465082132348369
     22025-10-27T15:11:19.771681Z TestFramework (INFO): Initializing test directory /var/folders/7j/m0yjzmhj4ys9jgl353v2mqph0000gq/T/bitcoin_func_test_pozrxv5c
     32025-10-27T15:11:20.123898Z TestFramework (INFO): Valid block
     42025-10-27T15:11:20.128439Z TestFramework (INFO): Bad input hash for coinbase transaction
     52025-10-27T15:11:20.137980Z TestFramework (INFO): Block with no transactions
     62025-10-27T15:11:20.147410Z TestFramework (INFO): Truncated final transaction
     72025-10-27T15:11:20.153225Z TestFramework (INFO): Duplicate transaction
     82025-10-27T15:11:20.162608Z TestFramework (INFO): Transaction that spends from thin air
     92025-10-27T15:11:20.171805Z TestFramework (INFO): Non-final transaction
    102025-10-27T15:11:20.181233Z TestFramework (INFO): Bad tx count
    112025-10-27T15:11:20.185630Z TestFramework (INFO): Extremely high nBits
    122025-10-27T15:11:20.194551Z TestFramework (INFO): Lowering nBits should make the block invalid
    132025-10-27T15:11:20.204060Z TestFramework (INFO): Bad merkle root
    142025-10-27T15:11:20.213258Z TestFramework (INFO): Bad timestamps
    152025-10-27T15:11:20.234411Z TestFramework (INFO): Block must build on the current tip
    162025-10-27T15:11:20.243550Z TestFramework (INFO): Generate a block
    172025-10-27T15:11:20.243745Z TestFramework (INFO): A block template doesn't need PoW
    182025-10-27T15:11:20.248469Z TestFramework (INFO): Add proof of work
    192025-10-27T15:11:20.252985Z TestFramework (INFO): getblocktemplate call in previous tests did not submit the block
    202025-10-27T15:11:20.257838Z TestFramework (INFO): Submitting this block should succeed
    212025-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")
    22
    23Make sure the bitcoind server is running and that you are connecting to the correct RPC port.
    24Use "bitcoin-cli -help" for more info.
    25'; stderr='None';
    26Traceback (most recent call last):
    27  File "/Users/brunogarcia/projects/bitcoin-core-dev/test/functional/test_framework/test_framework.py", line 142, in main
    28    self.run_test()
    29    ~~~~~~~~~~~~~^^
    30  File "/Users/brunogarcia/projects/bitcoin-core-dev/./build/test/functional/mining_template_verification.py", line 312, in run_test
    31    self.submit_test(node, block_0_height, block_2)
    32    ~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    33  File "/Users/brunogarcia/projects/bitcoin-core-dev/./build/test/functional/mining_template_verification.py", line 198, in submit_test
    34    node.waitforblockheight(200000)
    35    ~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^
    36  File "/Users/brunogarcia/projects/bitcoin-core-dev/test/functional/test_framework/test_node.py", line 907, in __call__
    37    return self.cli.send_cli(self.command, *args, **kwargs)
    38           ~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    39  File "/Users/brunogarcia/projects/bitcoin-core-dev/test/functional/test_framework/test_node.py", line 992, in send_cli
    40    raise subprocess.CalledProcessError(returncode, p_args, output=cli_stderr)
    41subprocess.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.
    42...
    43./build/test/functional/mining_template_verification.py --timeout-factor=0.1   0.27s user 0.18s system 11% cpu 3.966 total
    
     0➜  bitcoin-core-dev git:(33698) ✗ time ./build/test/functional/mining_template_verification.py --timeout-factor=0.1
     12025-10-27T15:12:02.776857Z TestFramework (INFO): PRNG seed is: 5466641224519577849
     22025-10-27T15:12:02.777325Z TestFramework (INFO): Initializing test directory /var/folders/7j/m0yjzmhj4ys9jgl353v2mqph0000gq/T/bitcoin_func_test_8hof5ivk
     32025-10-27T15:12:03.068521Z TestFramework (INFO): Valid block
     42025-10-27T15:12:03.069022Z TestFramework (INFO): Bad input hash for coinbase transaction
     52025-10-27T15:12:03.069738Z TestFramework (INFO): Block with no transactions
     62025-10-27T15:12:03.070405Z TestFramework (INFO): Truncated final transaction
     72025-10-27T15:12:03.071279Z TestFramework (INFO): Duplicate transaction
     82025-10-27T15:12:03.071856Z TestFramework (INFO): Transaction that spends from thin air
     92025-10-27T15:12:03.072801Z TestFramework (INFO): Non-final transaction
    102025-10-27T15:12:03.073370Z TestFramework (INFO): Bad tx count
    112025-10-27T15:12:03.073657Z TestFramework (INFO): Extremely high nBits
    122025-10-27T15:12:03.074199Z TestFramework (INFO): Lowering nBits should make the block invalid
    132025-10-27T15:12:03.074730Z TestFramework (INFO): Bad merkle root
    142025-10-27T15:12:03.075252Z TestFramework (INFO): Bad timestamps
    152025-10-27T15:12:03.076494Z TestFramework (INFO): Block must build on the current tip
    162025-10-27T15:12:03.077043Z TestFramework (INFO): Generate a block
    172025-10-27T15:12:03.077104Z TestFramework (INFO): A block template doesn't need PoW
    182025-10-27T15:12:03.077403Z TestFramework (INFO): Add proof of work
    192025-10-27T15:12:03.077684Z TestFramework (INFO): getblocktemplate call in previous tests did not submit the block
    202025-10-27T15:12:03.077887Z TestFramework (INFO): Submitting this block should succeed
    212025-10-27T15:12:06.080008Z TestFramework (ERROR): Unexpected exception
    22Traceback (most recent call last):
    23  File "/Users/brunogarcia/projects/bitcoin-core-dev/test/functional/test_framework/authproxy.py", line 174, in _get_response
    24    http_response = self.__conn.getresponse()
    25  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
    26    response.begin()
    27    ~~~~~~~~~~~~~~^^
    28  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
    29    version, status, reason = self._read_status()
    30                              ~~~~~~~~~~~~~~~~~^^
    31  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
    32    line = str(self.fp.readline(_MAXLINE + 1), "iso-8859-1")
    33               ~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^
    34  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
    35    return self._sock.recv_into(b)
    36           ~~~~~~~~~~~~~~~~~~~~^^^
    37TimeoutError: timed out
    38
    39During handling of the above exception, another exception occurred:
    40
    41Traceback (most recent call last):
    42  File "/Users/brunogarcia/projects/bitcoin-core-dev/test/functional/test_framework/test_framework.py", line 142, in main
    43    self.run_test()
    44    ~~~~~~~~~~~~~^^
    45  File "/Users/brunogarcia/projects/bitcoin-core-dev/./build/test/functional/mining_template_verification.py", line 312, in run_test
    46    self.submit_test(node, block_0_height, block_2)
    47    ~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    48  File "/Users/brunogarcia/projects/bitcoin-core-dev/./build/test/functional/mining_template_verification.py", line 198, in submit_test
    49    node.waitforblockheight(200000)
    50    ~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^
    51  File "/Users/brunogarcia/projects/bitcoin-core-dev/test/functional/test_framework/coverage.py", line 50, in __call__
    52    return_val = self.auth_service_proxy_instance.__call__(*args, **kwargs)
    53  File "/Users/brunogarcia/projects/bitcoin-core-dev/test/functional/test_framework/authproxy.py", line 137, in __call__
    54    response, status = self._request('POST', self.__url.path, postdata.encode('utf-8'))
    55                       ~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    56  File "/Users/brunogarcia/projects/bitcoin-core-dev/test/functional/test_framework/authproxy.py", line 111, in _request
    57    return self._get_response()
    58           ~~~~~~~~~~~~~~~~~~^^
    59  File "/Users/brunogarcia/projects/bitcoin-core-dev/test/functional/test_framework/authproxy.py", line 176, in _get_response
    60    raise JSONRPCException({
    61    ...<4 lines>...
    62                                          self.__conn.timeout)})
    63test_framework.authproxy.JSONRPCException: 'waitforblockheight' RPC took longer than 3.000000 seconds. Consider using larger timeout for calls that take longer to return. (-344)
    642025-10-27T15:12:06.145763Z TestFramework (INFO): Not stopping nodes as test failed. The dangling processes will be cleaned up later.
    652025-10-27T15:12:06.145917Z TestFramework (WARNING): Not cleaning up dir /var/folders/7j/m0yjzmhj4ys9jgl353v2mqph0000gq/T/bitcoin_func_test_8hof5ivk
    662025-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
    672025-10-27T15:12:06.146096Z TestFramework (ERROR):
    682025-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
    692025-10-27T15:12:06.146294Z TestFramework (ERROR):
    702025-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.
    712025-10-27T15:12:06.146399Z TestFramework (ERROR): https://github.com/bitcoin/bitcoin/issues
    722025-10-27T15:12:06.146433Z TestFramework (ERROR):
    73[node 0] Cleaning up leftover process
    74./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:

     0➜  bitcoin-core-dev git:(master) ✗ time ./build/test/functional/mining_template_verification.py --timeout-factor=0.1 --usecli
     12025-10-27T15:22:32.880207Z TestFramework (INFO): PRNG seed is: 1092200578974713961
     22025-10-27T15:22:32.880732Z TestFramework (INFO): Initializing test directory /var/folders/7j/m0yjzmhj4ys9jgl353v2mqph0000gq/T/bitcoin_func_test_e_yi4rfx
     32025-10-27T15:22:33.230171Z TestFramework (INFO): Valid block
     42025-10-27T15:22:33.234641Z TestFramework (INFO): Bad input hash for coinbase transaction
     52025-10-27T15:22:33.243711Z TestFramework (INFO): Block with no transactions
     62025-10-27T15:22:33.252973Z TestFramework (INFO): Truncated final transaction
     72025-10-27T15:22:33.258165Z TestFramework (INFO): Duplicate transaction
     82025-10-27T15:22:33.267783Z TestFramework (INFO): Transaction that spends from thin air
     92025-10-27T15:22:33.277660Z TestFramework (INFO): Non-final transaction
    102025-10-27T15:22:33.286685Z TestFramework (INFO): Bad tx count
    112025-10-27T15:22:33.291488Z TestFramework (INFO): Extremely high nBits
    122025-10-27T15:22:33.300580Z TestFramework (INFO): Lowering nBits should make the block invalid
    132025-10-27T15:22:33.310047Z TestFramework (INFO): Bad merkle root
    142025-10-27T15:22:33.319441Z TestFramework (INFO): Bad timestamps
    152025-10-27T15:22:33.338122Z TestFramework (INFO): Block must build on the current tip
    162025-10-27T15:22:33.347130Z TestFramework (INFO): Generate a block
    172025-10-27T15:22:33.347295Z TestFramework (INFO): A block template doesn't need PoW
    182025-10-27T15:22:33.351339Z TestFramework (INFO): Add proof of work
    192025-10-27T15:22:33.355839Z TestFramework (INFO): getblocktemplate call in previous tests did not submit the block
    202025-10-27T15:22:33.360846Z TestFramework (INFO): Submitting this block should succeed
    21^C2025-10-27T15:29:47.689592Z TestFramework (ERROR): Unexpected exception
    22Traceback (most recent call last):
    23 File "/Users/brunogarcia/projects/bitcoin-core-dev/test/functional/test_framework/test_framework.py", line 142, in main
    24   self.run_test()
    25   ~~~~~~~~~~~~~^^
    26 File "/Users/brunogarcia/projects/bitcoin-core-dev/./build/test/functional/mining_template_verification.py", line 312, in run_test
    27   self.submit_test(node, block_0_height, block_2)
    28   ~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    29 File "/Users/brunogarcia/projects/bitcoin-core-dev/./build/test/functional/mining_template_verification.py", line 198, in submit_test
    30   node.waitforblockheight(200000)
    31   ~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^
    32 File "/Users/brunogarcia/projects/bitcoin-core-dev/test/functional/test_framework/test_node.py", line 903, in __call__
    33   return self.cli.send_cli(self.command, *args, **kwargs)
    34          ~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    35 File "/Users/brunogarcia/projects/bitcoin-core-dev/test/functional/test_framework/test_node.py", line 976, in send_cli
    36   cli_stdout, cli_stderr = process.communicate(input=stdin_data)
    37                            ~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^
    38 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
    39   stdout, stderr = self._communicate(input, endtime, timeout)
    40                    ~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^
    41 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
    42   ready = selector.select(timeout)
    43 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
    44   fd_event_list = self._selector.poll(timeout)
    45KeyboardInterrupt
    462025-10-27T15:29:47.751786Z TestFramework (INFO): Not stopping nodes as test failed. The dangling processes will be cleaned up later.
    472025-10-27T15:29:47.751941Z TestFramework (WARNING): Not cleaning up dir /var/folders/7j/m0yjzmhj4ys9jgl353v2mqph0000gq/T/bitcoin_func_test_e_yi4rfx
    482025-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
    492025-10-27T15:29:47.752100Z TestFramework (ERROR):
    502025-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
    512025-10-27T15:29:47.752233Z TestFramework (ERROR):
    522025-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.
    532025-10-27T15:29:47.752332Z TestFramework (ERROR): https://github.com/bitcoin/bitcoin/issues
    542025-10-27T15:29:47.752358Z TestFramework (ERROR):
    55[node 0] Cleaning up leftover process
    56./build/test/functional/mining_template_verification.py --timeout-factor=0.1   0.55s user 0.42s system 0% cpu 7:15.28 total
    
     0➜  bitcoin-core-dev git:(master) ✗ time ./build/test/functional/mining_template_verification.py --timeout-factor=0.1
     12025-10-27T15:21:42.197156Z TestFramework (INFO): PRNG seed is: 270036072508533590
     22025-10-27T15:21:42.197649Z TestFramework (INFO): Initializing test directory /var/folders/7j/m0yjzmhj4ys9jgl353v2mqph0000gq/T/bitcoin_func_test_ecyhnza6
     32025-10-27T15:21:42.499371Z TestFramework (INFO): Valid block
     42025-10-27T15:21:42.499752Z TestFramework (INFO): Bad input hash for coinbase transaction
     52025-10-27T15:21:42.500380Z TestFramework (INFO): Block with no transactions
     62025-10-27T15:21:42.500912Z TestFramework (INFO): Truncated final transaction
     72025-10-27T15:21:42.502666Z TestFramework (INFO): Duplicate transaction
     82025-10-27T15:21:42.503447Z TestFramework (INFO): Transaction that spends from thin air
     92025-10-27T15:21:42.504407Z TestFramework (INFO): Non-final transaction
    102025-10-27T15:21:42.504941Z TestFramework (INFO): Bad tx count
    112025-10-27T15:21:42.505222Z TestFramework (INFO): Extremely high nBits
    122025-10-27T15:21:42.505694Z TestFramework (INFO): Lowering nBits should make the block invalid
    132025-10-27T15:21:42.506203Z TestFramework (INFO): Bad merkle root
    142025-10-27T15:21:42.506635Z TestFramework (INFO): Bad timestamps
    152025-10-27T15:21:42.507951Z TestFramework (INFO): Block must build on the current tip
    162025-10-27T15:21:42.508765Z TestFramework (INFO): Generate a block
    172025-10-27T15:21:42.508838Z TestFramework (INFO): A block template doesn't need PoW
    182025-10-27T15:21:42.509287Z TestFramework (INFO): Add proof of work
    192025-10-27T15:21:42.509694Z TestFramework (INFO): getblocktemplate call in previous tests did not submit the block
    202025-10-27T15:21:42.510011Z TestFramework (INFO): Submitting this block should succeed
    212025-10-27T15:21:45.511799Z TestFramework (ERROR): Unexpected exception
    22Traceback (most recent call last):
    23  File "/Users/brunogarcia/projects/bitcoin-core-dev/test/functional/test_framework/authproxy.py", line 174, in _get_response
    24    http_response = self.__conn.getresponse()
    25  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
    26    response.begin()
    27    ~~~~~~~~~~~~~~^^
    28  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
    29    version, status, reason = self._read_status()
    30                              ~~~~~~~~~~~~~~~~~^^
    31  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
    32    line = str(self.fp.readline(_MAXLINE + 1), "iso-8859-1")
    33               ~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^
    34  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
    35    return self._sock.recv_into(b)
    36           ~~~~~~~~~~~~~~~~~~~~^^^
    37TimeoutError: timed out
    38
    39During handling of the above exception, another exception occurred:
    40
    41Traceback (most recent call last):
    42  File "/Users/brunogarcia/projects/bitcoin-core-dev/test/functional/test_framework/test_framework.py", line 142, in main
    43    self.run_test()
    44    ~~~~~~~~~~~~~^^
    45  File "/Users/brunogarcia/projects/bitcoin-core-dev/./build/test/functional/mining_template_verification.py", line 312, in run_test
    46    self.submit_test(node, block_0_height, block_2)
    47    ~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    48  File "/Users/brunogarcia/projects/bitcoin-core-dev/./build/test/functional/mining_template_verification.py", line 198, in submit_test
    49    node.waitforblockheight(200000)
    50    ~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^
    51  File "/Users/brunogarcia/projects/bitcoin-core-dev/test/functional/test_framework/coverage.py", line 50, in __call__
    52    return_val = self.auth_service_proxy_instance.__call__(*args, **kwargs)
    53  File "/Users/brunogarcia/projects/bitcoin-core-dev/test/functional/test_framework/authproxy.py", line 137, in __call__
    54    response, status = self._request('POST', self.__url.path, postdata.encode('utf-8'))
    55                       ~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    56  File "/Users/brunogarcia/projects/bitcoin-core-dev/test/functional/test_framework/authproxy.py", line 111, in _request
    57    return self._get_response()
    58           ~~~~~~~~~~~~~~~~~~^^
    59  File "/Users/brunogarcia/projects/bitcoin-core-dev/test/functional/test_framework/authproxy.py", line 176, in _get_response
    60    raise JSONRPCException({
    61    ...<4 lines>...
    62                                          self.__conn.timeout)})
    63test_framework.authproxy.JSONRPCException: 'waitforblockheight' RPC took longer than 3.000000 seconds. Consider using larger timeout for calls that take longer to return. (-344)
    642025-10-27T15:21:45.567977Z TestFramework (INFO): Not stopping nodes as test failed. The dangling processes will be cleaned up later.
    652025-10-27T15:21:45.568097Z TestFramework (WARNING): Not cleaning up dir /var/folders/7j/m0yjzmhj4ys9jgl353v2mqph0000gq/T/bitcoin_func_test_ecyhnza6
    662025-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
    672025-10-27T15:21:45.568213Z TestFramework (ERROR):
    682025-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
    692025-10-27T15:21:45.568347Z TestFramework (ERROR):
    702025-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.
    712025-10-27T15:21:45.568419Z TestFramework (ERROR): https://github.com/bitcoin/bitcoin/issues
    722025-10-27T15:21:45.568443Z TestFramework (ERROR):
    73[node 0] Cleaning up leftover process
    74./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: 2025-12-02 21:13 UTC

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