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:
0 self.log.info("Start bitcoin with -noversion for version information")
1 self.nodes[0].start(extra_args=['-version=0']) # -version=1 works
2 # Node should exit immediately and output version to stdout.
3 output, _ = self.get_node_output(ret_code_expected=0)
4 assert b'version' in output
5 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:
02024-12-04T15:35:30.230000Z TestFramework (INFO): PRNG seed is: 6906262290736093521
12024-12-04T15:35:30.230000Z TestFramework (DEBUG): Setting up network thread
22024-12-04T15:35:30.231000Z TestFramework (INFO): Initializing test directory /tmp/bitcoin_func_test_n5c4b731
32024-12-04T15:35:30.231000Z TestFramework (INFO): Start bitcoin with -h for help text
42024-12-04T15:35:30.232000Z TestFramework.node0 (DEBUG): bitcoind started, waiting for RPC to come up
52024-12-04T15:35:30.239000Z TestFramework (INFO): Help text received: b'Bitcoin Core daemon version v28.99.0-95a0104f2e98-dirty\n\nThe' (...)
62024-12-04T15:35:30.239000Z TestFramework (INFO): Start bitcoin with -version for version information
72024-12-04T15:35:30.240000Z TestFramework.node0 (DEBUG): bitcoind started, waiting for RPC to come up
82024-12-04T15:36:30.240000Z TestFramework (ERROR): Unexpected exception caught during testing
9Traceback (most recent call last):
10 File "/home/hodlinator/bitcoin/test/functional/test_framework/test_framework.py", line 132, in main
11 self.run_test()
12 File "/home/hodlinator/bitcoin/build/test/functional/feature_help.py", line 48, in run_test
13 output, _ = self.get_node_output(ret_code_expected=0)
14 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
15 File "/home/hodlinator/bitcoin/build/test/functional/feature_help.py", line 20, in get_node_output
16 ret_code = self.nodes[0].process.wait(timeout=60)
17 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
18 File "/nix/store/wfbjq35kxs6x83c3ncpfxdyl5gbhdx4h-python3-3.12.6/lib/python3.12/subprocess.py", line 1264, in wait
19 return self._wait(timeout=timeout)
20 ^^^^^^^^^^^^^^^^^^^^^^^^^^^
21 File "/nix/store/wfbjq35kxs6x83c3ncpfxdyl5gbhdx4h-python3-3.12.6/lib/python3.12/subprocess.py", line 2045, in _wait
22 raise TimeoutExpired(self.args, timeout)
23subprocess.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
242024-12-04T15:36:30.245000Z TestFramework (DEBUG): Closing down network thread
252024-12-04T15:36:30.296000Z TestFramework (INFO): Stopping nodes
262024-12-04T15:36:30.296000Z TestFramework.node0 (DEBUG): Stopping node
27Traceback (most recent call last):
28 File "/home/hodlinator/bitcoin/build/test/functional/feature_help.py", line 62, in <module>
29 HelpTest(__file__).main()
30 File "/home/hodlinator/bitcoin/test/functional/test_framework/test_framework.py", line 155, in main
31 exit_code = self.shutdown()
32 ^^^^^^^^^^^^^^^
33 File "/home/hodlinator/bitcoin/test/functional/test_framework/test_framework.py", line 318, in shutdown
34 self.stop_nodes()
35 File "/home/hodlinator/bitcoin/test/functional/test_framework/test_framework.py", line 587, in stop_nodes
36 node.stop_node(wait=wait, wait_until_stopped=False)
37 File "/home/hodlinator/bitcoin/test/functional/test_framework/test_node.py", line 397, in stop_node
38 self.stop(wait=wait)
39 ^^^^^^^^^
40 File "/home/hodlinator/bitcoin/test/functional/test_framework/test_node.py", line 215, in __getattr__
41 assert self.rpc_connected and self.rpc is not None, self._node_msg("Error: no RPC connection")
42 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
43AssertionError: [node 0] Error: no RPC connection
44[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.
02024-12-04T15:41:34.993000Z TestFramework (INFO): PRNG seed is: 7034279536394037572
12024-12-04T15:41:34.994000Z TestFramework (DEBUG): Setting up network thread
22024-12-04T15:41:34.994000Z TestFramework (INFO): Initializing test directory /tmp/bitcoin_func_test_3wqbq2m9
32024-12-04T15:41:34.994000Z TestFramework (INFO): Start bitcoin with -h for help text
42024-12-04T15:41:34.995000Z TestFramework.node0 (DEBUG): bitcoind started with PID 881245, waiting for RPC to come up
52024-12-04T15:41:35.002000Z TestFramework (INFO): Help text received: b'Bitcoin Core daemon version v28.99.0-95a0104f2e98-dirty\n\nThe' (...)
62024-12-04T15:41:35.002000Z TestFramework (INFO): Start bitcoin with -version for version information
72024-12-04T15:41:35.003000Z TestFramework.node0 (DEBUG): bitcoind started with PID 881246, waiting for RPC to come up
82024-12-04T15:42:35.004000Z TestFramework (ERROR): Unexpected exception caught during testing
9Traceback (most recent call last):
10 File "/home/hodlinator/bitcoin/test/functional/test_framework/test_framework.py", line 132, in main
11 self.run_test()
12 File "/home/hodlinator/bitcoin/build/test/functional/feature_help.py", line 48, in run_test
13 output, _ = self.get_node_output(ret_code_expected=0)
14 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
15 File "/home/hodlinator/bitcoin/build/test/functional/feature_help.py", line 20, in get_node_output
16 ret_code = self.nodes[0].process.wait(timeout=60)
17 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
18 File "/nix/store/wfbjq35kxs6x83c3ncpfxdyl5gbhdx4h-python3-3.12.6/lib/python3.12/subprocess.py", line 1264, in wait
19 return self._wait(timeout=timeout)
20 ^^^^^^^^^^^^^^^^^^^^^^^^^^^
21 File "/nix/store/wfbjq35kxs6x83c3ncpfxdyl5gbhdx4h-python3-3.12.6/lib/python3.12/subprocess.py", line 2045, in _wait
22 raise TimeoutExpired(self.args, timeout)
23subprocess.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
242024-12-04T15:42:35.009000Z TestFramework (DEBUG): Closing down network thread
252024-12-04T15:42:35.060000Z TestFramework (INFO): Stopping nodes
262024-12-04T15:42:35.060000Z TestFramework.node0 (DEBUG): Stopping node
272024-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.
282024-12-04T15:42:35.111000Z TestFramework.node0 (DEBUG): Node stopped
292024-12-04T15:42:35.111000Z TestFramework (WARNING): Not cleaning up dir /tmp/bitcoin_func_test_3wqbq2m9
302024-12-04T15:42:35.111000Z TestFramework (ERROR): Test failed. Test logging available at /tmp/bitcoin_func_test_3wqbq2m9/test_framework.log
312024-12-04T15:42:35.111000Z TestFramework (ERROR):
322024-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
332024-12-04T15:42:35.112000Z TestFramework (ERROR):
342024-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.
352024-12-04T15:42:35.112000Z TestFramework (ERROR): https://github.com/bitcoin/bitcoin/issues
362024-12-04T15:42:35.112000Z TestFramework (ERROR):