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

issue fanquake opened 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:

    python3.9 test/functional/test_runner.py --jobs=3           
    Temporary test directory at /tmp/test_runner_₿_🏃_20220104_002803
    Running Unit Tests for Test Framework Modules
    ..........
    ----------------------------------------------------------------------
    Ran 10 tests in 1.310s
    
    OK
    Traceback (most recent call last):
      File "/home/ec2-user/bitcoin/test/functional/create_cache.py", line 27, in <module>
        CreateCache().main()
      File "/home/ec2-user/bitcoin/test/functional/test_framework/test_framework.py", line 155, in main
        exit_code = self.shutdown()
      File "/home/ec2-user/bitcoin/test/functional/test_framework/test_framework.py", line 304, in shutdown
        self.stop_nodes()
      File "/home/ec2-user/bitcoin/test/functional/test_framework/test_framework.py", line 555, in stop_nodes
        node.stop_node(wait=wait, wait_until_stopped=False)
      File "/home/ec2-user/bitcoin/test/functional/test_framework/test_node.py", line 336, in stop_node
        self.stop(wait=wait)
      File "/home/ec2-user/bitcoin/test/functional/test_framework/coverage.py", line 49, in __call__
        return_val = self.auth_service_proxy_instance.__call__(*args, **kwargs)
      File "/home/ec2-user/bitcoin/test/functional/test_framework/authproxy.py", line 142, in __call__
        response, status = self._request('POST', self.__url.path, postdata.encode('utf-8'))
      File "/home/ec2-user/bitcoin/test/functional/test_framework/authproxy.py", line 107, in _request
        self.__conn.request(method, path, postdata, headers)
      File "/usr/pkg/lib/python3.9/http/client.py", line 1279, in request
        self._send_request(method, url, body, headers, encode_chunked)
      File "/usr/pkg/lib/python3.9/http/client.py", line 1325, in _send_request
        self.endheaders(body, encode_chunked=encode_chunked)
      File "/usr/pkg/lib/python3.9/http/client.py", line 1274, in endheaders
        self._send_output(message_body, encode_chunked=encode_chunked)
      File "/usr/pkg/lib/python3.9/http/client.py", line 1034, in _send_output
        self.send(msg)
      File "/usr/pkg/lib/python3.9/http/client.py", line 974, in send
        self.connect()
      File "/usr/pkg/lib/python3.9/http/client.py", line 945, in connect
        self.sock = self._create_connection(
      File "/usr/pkg/lib/python3.9/socket.py", line 844, in create_connection
        raise err
      File "/usr/pkg/lib/python3.9/socket.py", line 832, in create_connection
        sock.connect(sa)
    ConnectionRefusedError: [Errno 61] Connection refused
    2022-01-04T00:28:04.864000Z TestFramework (INFO): Initializing test directory /tmp/test_runner_₿_🏃_20220104_002803/cache
    2022-01-04T00:28:05.605000Z TestFramework (ERROR): Assertion failed
    Traceback (most recent call last):
      File "/home/ec2-user/bitcoin/test/functional/test_framework/test_framework.py", line 131, in main
        self.setup()
      File "/home/ec2-user/bitcoin/test/functional/test_framework/test_framework.py", line 287, in setup
        self.setup_chain()
      File "/home/ec2-user/bitcoin/test/functional/test_framework/test_framework.py", line 378, in setup_chain
        self._initialize_chain()
      File "/home/ec2-user/bitcoin/test/functional/test_framework/test_framework.py", line 792, in _initialize_chain
        self.stop_nodes()
      File "/home/ec2-user/bitcoin/test/functional/test_framework/test_framework.py", line 555, in stop_nodes
        node.stop_node(wait=wait, wait_until_stopped=False)
      File "/home/ec2-user/bitcoin/test/functional/test_framework/test_node.py", line 350, in stop_node
        raise AssertionError("Unexpected stderr {} != {}".format(stderr, expected_stderr))
    AssertionError: Unexpected stderr Warning: Reducing -maxconnections from 125 to 96, because of system limitations. != 
    2022-01-04T00:28:05.663000Z TestFramework (INFO): Stopping nodes
    [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

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-04-24 21:14 UTC

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