qa: BitcoinTestFramework fails with extra_args=-nolisten #20177

issue hebasto opened this issue on October 17, 2020
  1. hebasto commented at 6:02 PM on October 17, 2020: member

    The following code

    #!/usr/bin/env python3
    
    from test_framework.test_framework import BitcoinTestFramework
    
    
    class NolistenTest(BitcoinTestFramework):
        def set_test_params(self):
            self.num_nodes = 1
            self.extra_args = [["-listen=0"]]  # Comment out to pass.
    
        def setup_network(self):
            self.setup_nodes()
    
        def run_test(self):
            self.log.info("Starting test!")
    
    
    if __name__ == '__main__':
        NolistenTest().main()
    

    returns

    $ test/functional/feature_nolisten.py 
    2020-10-17T17:52:20.992000Z TestFramework (INFO): Initializing test directory /tmp/bitcoin_func_test_qiov8cs8
    2020-10-17T17:52:21.252000Z TestFramework (ERROR): Assertion failed
    Traceback (most recent call last):
      File "/home/hebasto/guix/GitHub/bitcoin/test/functional/test_framework/test_framework.py", line 498, in start_nodes
        node.wait_for_rpc_connection()
      File "/home/hebasto/guix/GitHub/bitcoin/test/functional/test_framework/test_node.py", line 220, in wait_for_rpc_connection
        raise FailedToStartError(self._node_msg(
    test_framework.test_node.FailedToStartError: [node 0] bitcoind exited with status 1 during initialization
    
    During handling of the above exception, another exception occurred:
    
    Traceback (most recent call last):
      File "/home/hebasto/guix/GitHub/bitcoin/test/functional/test_framework/test_framework.py", line 125, in main
        self.setup()
      File "/home/hebasto/guix/GitHub/bitcoin/test/functional/test_framework/test_framework.py", line 257, in setup
        self.setup_network()
      File "test/functional/feature_nolisten.py", line 15, in setup_network
        self.setup_nodes()
      File "/home/hebasto/guix/GitHub/bitcoin/test/functional/test_framework/test_framework.py", line 376, in setup_nodes
        self.start_nodes()
      File "/home/hebasto/guix/GitHub/bitcoin/test/functional/test_framework/test_framework.py", line 501, in start_nodes
        self.stop_nodes()
      File "/home/hebasto/guix/GitHub/bitcoin/test/functional/test_framework/test_framework.py", line 517, in stop_nodes
        node.stop_node(wait=wait)
      File "/home/hebasto/guix/GitHub/bitcoin/test/functional/test_framework/test_node.py", line 319, in stop_node
        self.stop(wait=wait)
      File "/home/hebasto/guix/GitHub/bitcoin/test/functional/test_framework/test_node.py", line 179, in __getattr__
        assert self.rpc_connected and self.rpc is not None, self._node_msg("Error: no RPC connection")
    AssertionError: [node 0] Error: no RPC connection
    2020-10-17T17:52:21.303000Z TestFramework (INFO): Stopping nodes
    Traceback (most recent call last):
      File "test/functional/feature_nolisten.py", line 22, in <module>
        NolistenTest().main()
      File "/home/hebasto/guix/GitHub/bitcoin/test/functional/test_framework/test_framework.py", line 149, in main
        exit_code = self.shutdown()
      File "/home/hebasto/guix/GitHub/bitcoin/test/functional/test_framework/test_framework.py", line 273, in shutdown
        self.stop_nodes()
      File "/home/hebasto/guix/GitHub/bitcoin/test/functional/test_framework/test_framework.py", line 517, in stop_nodes
        node.stop_node(wait=wait)
      File "/home/hebasto/guix/GitHub/bitcoin/test/functional/test_framework/test_node.py", line 319, in stop_node
        self.stop(wait=wait)
      File "/home/hebasto/guix/GitHub/bitcoin/test/functional/test_framework/test_node.py", line 179, in __getattr__
        assert self.rpc_connected and self.rpc is not None, self._node_msg("Error: no RPC connection")
    AssertionError: [node 0] Error: no RPC connection
    [node 0] Cleaning up leftover process
    
  2. hebasto added the label Bug on Oct 17, 2020
  3. MarcoFalke commented at 6:11 PM on October 17, 2020: member

    What is the combined logs of /tmp/bitcoin_func_test_qiov8cs8?

  4. hebasto commented at 6:35 PM on October 17, 2020: member

    The reason is bind=127.0.0.1 in the default bitcoin.conf:

    Error: Cannot set -bind or -whitebind together with -listen=0
    

    Is it possible to get non-listening node without replacing bitcoin.conf?

  5. MarcoFalke commented at 7:08 PM on October 17, 2020: member

    Is bind nullable? -nobind -nolisten?

  6. MarcoFalke commented at 7:33 PM on October 17, 2020: member

    It is nullable for me. Let me know if that didn't work.

  7. MarcoFalke closed this on Oct 17, 2020

  8. hebasto commented at 7:50 PM on October 17, 2020: member

    @MarcoFalke

    Is bind nullable? -nobind -nolisten?

    Thanks! It works :+1:

  9. DrahtBot locked this on Feb 15, 2022
Contributors
Labels

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