Thanks @ryanofsky for arguing my case. One could possibly stretch -noversion to actually remove the version from the default log, but not sure if that would be more useful. The fact that one of -version/-noversion exits quickly is mildly confusing.
Tried:
self.log.info("Start bitcoin with -noversion for version information")
self.nodes[0].start(extra_args=['-version=0']) # -version=1 works
# Node should exit immediately and output version to stdout.
output, _ = self.get_node_output(ret_code_expected=0)
assert b'version' in output
self.log.info(f"Version text received: {output[0:60]} (...)")
which just hangs with no RPC connection available.
That is slightly incorrect. Here is the full error I got when trying to reproduce your change:
2024-12-04T15:35:30.230000Z TestFramework (INFO): PRNG seed is: 6906262290736093521
2024-12-04T15:35:30.230000Z TestFramework (DEBUG): Setting up network thread
2024-12-04T15:35:30.231000Z TestFramework (INFO): Initializing test directory /tmp/bitcoin_func_test_n5c4b731
2024-12-04T15:35:30.231000Z TestFramework (INFO): Start bitcoin with -h for help text
2024-12-04T15:35:30.232000Z TestFramework.node0 (DEBUG): bitcoind started, waiting for RPC to come up
2024-12-04T15:35:30.239000Z TestFramework (INFO): Help text received: b'Bitcoin Core daemon version v28.99.0-95a0104f2e98-dirty\n\nThe' (...)
2024-12-04T15:35:30.239000Z TestFramework (INFO): Start bitcoin with -version for version information
2024-12-04T15:35:30.240000Z TestFramework.node0 (DEBUG): bitcoind started, waiting for RPC to come up
2024-12-04T15:36:30.240000Z TestFramework (ERROR): Unexpected exception caught during testing
Traceback (most recent call last):
File "/home/hodlinator/bitcoin/test/functional/test_framework/test_framework.py", line 132, in main
self.run_test()
File "/home/hodlinator/bitcoin/build/test/functional/feature_help.py", line 48, in run_test
output, _ = self.get_node_output(ret_code_expected=0)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/hodlinator/bitcoin/build/test/functional/feature_help.py", line 20, in get_node_output
ret_code = self.nodes[0].process.wait(timeout=60)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/nix/store/wfbjq35kxs6x83c3ncpfxdyl5gbhdx4h-python3-3.12.6/lib/python3.12/subprocess.py", line 1264, in wait
return self._wait(timeout=timeout)
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/nix/store/wfbjq35kxs6x83c3ncpfxdyl5gbhdx4h-python3-3.12.6/lib/python3.12/subprocess.py", line 2045, in _wait
raise TimeoutExpired(self.args, timeout)
subprocess.TimeoutExpired: Command '['/home/hodlinator/bitcoin/build/src/bitcoind', '-datadir=/tmp/bitcoin_func_test_n5c4b731/node0', '-logtimemicros', '-debug', '-debugexclude=libevent', '-debugexclude=leveldb', '-debugexclude=rand', '-uacomment=testnode0', '-disablewallet', '-logthreadnames', '-logsourcelocations', '-loglevel=trace', '-v2transport=0', '-version=0']' timed out after 60 seconds
2024-12-04T15:36:30.245000Z TestFramework (DEBUG): Closing down network thread
2024-12-04T15:36:30.296000Z TestFramework (INFO): Stopping nodes
2024-12-04T15:36:30.296000Z TestFramework.node0 (DEBUG): Stopping node
Traceback (most recent call last):
File "/home/hodlinator/bitcoin/build/test/functional/feature_help.py", line 62, in <module>
HelpTest(__file__).main()
File "/home/hodlinator/bitcoin/test/functional/test_framework/test_framework.py", line 155, in main
exit_code = self.shutdown()
^^^^^^^^^^^^^^^
File "/home/hodlinator/bitcoin/test/functional/test_framework/test_framework.py", line 318, in shutdown
self.stop_nodes()
File "/home/hodlinator/bitcoin/test/functional/test_framework/test_framework.py", line 587, in stop_nodes
node.stop_node(wait=wait, wait_until_stopped=False)
File "/home/hodlinator/bitcoin/test/functional/test_framework/test_node.py", line 397, in stop_node
self.stop(wait=wait)
^^^^^^^^^
File "/home/hodlinator/bitcoin/test/functional/test_framework/test_node.py", line 215, 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
It's the call to process.wait() in the local get_node_output() in feature_help.py that times out. The RPC assertion failure is just a knock-on issue that is fixed by #30660.
<details>
<summary>
Log with [#30660](/bitcoin-bitcoin/30660/) cherry-picked on top.
</summary>
2024-12-04T15:41:34.993000Z TestFramework (INFO): PRNG seed is: 7034279536394037572
2024-12-04T15:41:34.994000Z TestFramework (DEBUG): Setting up network thread
2024-12-04T15:41:34.994000Z TestFramework (INFO): Initializing test directory /tmp/bitcoin_func_test_3wqbq2m9
2024-12-04T15:41:34.994000Z TestFramework (INFO): Start bitcoin with -h for help text
2024-12-04T15:41:34.995000Z TestFramework.node0 (DEBUG): bitcoind started with PID 881245, waiting for RPC to come up
2024-12-04T15:41:35.002000Z TestFramework (INFO): Help text received: b'Bitcoin Core daemon version v28.99.0-95a0104f2e98-dirty\n\nThe' (...)
2024-12-04T15:41:35.002000Z TestFramework (INFO): Start bitcoin with -version for version information
2024-12-04T15:41:35.003000Z TestFramework.node0 (DEBUG): bitcoind started with PID 881246, waiting for RPC to come up
2024-12-04T15:42:35.004000Z TestFramework (ERROR): Unexpected exception caught during testing
Traceback (most recent call last):
File "/home/hodlinator/bitcoin/test/functional/test_framework/test_framework.py", line 132, in main
self.run_test()
File "/home/hodlinator/bitcoin/build/test/functional/feature_help.py", line 48, in run_test
output, _ = self.get_node_output(ret_code_expected=0)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/hodlinator/bitcoin/build/test/functional/feature_help.py", line 20, in get_node_output
ret_code = self.nodes[0].process.wait(timeout=60)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/nix/store/wfbjq35kxs6x83c3ncpfxdyl5gbhdx4h-python3-3.12.6/lib/python3.12/subprocess.py", line 1264, in wait
return self._wait(timeout=timeout)
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/nix/store/wfbjq35kxs6x83c3ncpfxdyl5gbhdx4h-python3-3.12.6/lib/python3.12/subprocess.py", line 2045, in _wait
raise TimeoutExpired(self.args, timeout)
subprocess.TimeoutExpired: Command '['/home/hodlinator/bitcoin/build/src/bitcoind', '-datadir=/tmp/bitcoin_func_test_3wqbq2m9/node0', '-logtimemicros', '-debug', '-debugexclude=libevent', '-debugexclude=leveldb', '-debugexclude=rand', '-uacomment=testnode0', '-disablewallet', '-logthreadnames', '-logsourcelocations', '-loglevel=trace', '-v2transport=0', '-version=0']' timed out after 60 seconds
2024-12-04T15:42:35.009000Z TestFramework (DEBUG): Closing down network thread
2024-12-04T15:42:35.060000Z TestFramework (INFO): Stopping nodes
2024-12-04T15:42:35.060000Z TestFramework.node0 (DEBUG): Stopping node
2024-12-04T15:42:35.060000Z TestFramework.node0 (WARNING): Cannot call stop-RPC as we are not connected. Killing process 881246 so that wait_until_stopped will not time out.
2024-12-04T15:42:35.111000Z TestFramework.node0 (DEBUG): Node stopped
2024-12-04T15:42:35.111000Z TestFramework (WARNING): Not cleaning up dir /tmp/bitcoin_func_test_3wqbq2m9
2024-12-04T15:42:35.111000Z TestFramework (ERROR): Test failed. Test logging available at /tmp/bitcoin_func_test_3wqbq2m9/test_framework.log
2024-12-04T15:42:35.111000Z TestFramework (ERROR):
2024-12-04T15:42:35.112000Z TestFramework (ERROR): Hint: Call /home/hodlinator/bitcoin/test/functional/combine_logs.py '/tmp/bitcoin_func_test_3wqbq2m9' to consolidate all logs
2024-12-04T15:42:35.112000Z TestFramework (ERROR):
2024-12-04T15:42:35.112000Z TestFramework (ERROR): If this failure happened unexpectedly or intermittently, please file a bug and provide a link or upload of the combined log.
2024-12-04T15:42:35.112000Z TestFramework (ERROR): https://github.com/bitcoin/bitcoin/issues
2024-12-04T15:42:35.112000Z TestFramework (ERROR):
</details>