test: functional tests fail to start if -maxconnections is reduced #23968

issue fanquake openend this issue on January 4, 2022
  1. fanquake commented at 6:23 am on January 4, 2022: member

    Noticed on NetBSD, but the same issue could happen on any other system. The issue is outputting the Reducing -maxconnections warning during startup:

    https://github.com/bitcoin/bitcoin/blob/2f37b221d183dfc8136fa71730acb8f218ad0dcb/src/init.cpp#L893-L898

    Which causes the tests to abort, due to unexpected output:

     0python3.9 test/functional/test_runner.py --jobs=3           
     1Temporary test directory at /tmp/test_runner_₿_🏃_20220104_002803
     2Running Unit Tests for Test Framework Modules
     3..........
     4----------------------------------------------------------------------
     5Ran 10 tests in 1.310s
     6
     7OK
     8Traceback (most recent call last):
     9  File "/home/ec2-user/bitcoin/test/functional/create_cache.py", line 27, in <module>
    10    CreateCache().main()
    11  File "/home/ec2-user/bitcoin/test/functional/test_framework/test_framework.py", line 155, in main
    12    exit_code = self.shutdown()
    13  File "/home/ec2-user/bitcoin/test/functional/test_framework/test_framework.py", line 304, in shutdown
    14    self.stop_nodes()
    15  File "/home/ec2-user/bitcoin/test/functional/test_framework/test_framework.py", line 555, in stop_nodes
    16    node.stop_node(wait=wait, wait_until_stopped=False)
    17  File "/home/ec2-user/bitcoin/test/functional/test_framework/test_node.py", line 336, in stop_node
    18    self.stop(wait=wait)
    19  File "/home/ec2-user/bitcoin/test/functional/test_framework/coverage.py", line 49, in __call__
    20    return_val = self.auth_service_proxy_instance.__call__(*args, **kwargs)
    21  File "/home/ec2-user/bitcoin/test/functional/test_framework/authproxy.py", line 142, in __call__
    22    response, status = self._request('POST', self.__url.path, postdata.encode('utf-8'))
    23  File "/home/ec2-user/bitcoin/test/functional/test_framework/authproxy.py", line 107, in _request
    24    self.__conn.request(method, path, postdata, headers)
    25  File "/usr/pkg/lib/python3.9/http/client.py", line 1279, in request
    26    self._send_request(method, url, body, headers, encode_chunked)
    27  File "/usr/pkg/lib/python3.9/http/client.py", line 1325, in _send_request
    28    self.endheaders(body, encode_chunked=encode_chunked)
    29  File "/usr/pkg/lib/python3.9/http/client.py", line 1274, in endheaders
    30    self._send_output(message_body, encode_chunked=encode_chunked)
    31  File "/usr/pkg/lib/python3.9/http/client.py", line 1034, in _send_output
    32    self.send(msg)
    33  File "/usr/pkg/lib/python3.9/http/client.py", line 974, in send
    34    self.connect()
    35  File "/usr/pkg/lib/python3.9/http/client.py", line 945, in connect
    36    self.sock = self._create_connection(
    37  File "/usr/pkg/lib/python3.9/socket.py", line 844, in create_connection
    38    raise err
    39  File "/usr/pkg/lib/python3.9/socket.py", line 832, in create_connection
    40    sock.connect(sa)
    41ConnectionRefusedError: [Errno 61] Connection refused
    422022-01-04T00:28:04.864000Z TestFramework (INFO): Initializing test directory /tmp/test_runner_₿_🏃_20220104_002803/cache
    432022-01-04T00:28:05.605000Z TestFramework (ERROR): Assertion failed
    44Traceback (most recent call last):
    45  File "/home/ec2-user/bitcoin/test/functional/test_framework/test_framework.py", line 131, in main
    46    self.setup()
    47  File "/home/ec2-user/bitcoin/test/functional/test_framework/test_framework.py", line 287, in setup
    48    self.setup_chain()
    49  File "/home/ec2-user/bitcoin/test/functional/test_framework/test_framework.py", line 378, in setup_chain
    50    self._initialize_chain()
    51  File "/home/ec2-user/bitcoin/test/functional/test_framework/test_framework.py", line 792, in _initialize_chain
    52    self.stop_nodes()
    53  File "/home/ec2-user/bitcoin/test/functional/test_framework/test_framework.py", line 555, in stop_nodes
    54    node.stop_node(wait=wait, wait_until_stopped=False)
    55  File "/home/ec2-user/bitcoin/test/functional/test_framework/test_node.py", line 350, in stop_node
    56    raise AssertionError("Unexpected stderr {} != {}".format(stderr, expected_stderr))
    57AssertionError: Unexpected stderr Warning: Reducing -maxconnections from 125 to 96, because of system limitations. != 
    582022-01-04T00:28:05.663000Z TestFramework (INFO): Stopping nodes
    59[node 0] Cleaning up leftover process
    
  2. fanquake added the label Tests on Jan 4, 2022
  3. maflcko commented at 7:41 am on January 4, 2022: member
    I think you can just globally reduce the -maxconnections=... for all tests in the config file. There is a constant MAX_NODES=12 or so
  4. achow101 closed this on Dec 30, 2024

  5. achow101 referenced this in commit fa3de038f7 on Dec 30, 2024
  6. knst referenced this in commit 0e95936d1b on Oct 22, 2025
  7. bitcoin locked this on Dec 30, 2025


fanquake maflcko

Labels
Tests


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-03-12 21:13 UTC

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