test: Fixup assert_debug_log timeouts in feature_config_args.py

* The bitcoin.conf related checks do not need any timeout, because the
  logging happens in the main thread, before the node is fully started.
* The net thread related checks do need a timeout, because the threads
  may be late to start after the node is fully started.
This commit is contained in:
MarcoFalke 2026-02-19 15:48:48 +01:00
parent faed837f27
commit fa4424fd98
No known key found for this signature in database

View File

@ -83,13 +83,13 @@ class ConfArgsTest(BitcoinTestFramework):
self.log.debug('Verifying that disabling of the config file means garbage inside of it does ' \
'not prevent the node from starting, and message about existing config file is logged')
ignored_file_message = [f'Data directory "{self.nodes[0].datadir_path}" contains a "bitcoin.conf" file which is explicitly ignored using -noconf.']
with self.nodes[0].assert_debug_log(timeout=60, expected_msgs=ignored_file_message):
with self.nodes[0].assert_debug_log(expected_msgs=ignored_file_message):
self.start_node(0, extra_args=settings + ['-noconf'])
self.stop_node(0)
self.log.debug('Verifying no message appears when removing config file')
os.remove(conf_path)
with self.nodes[0].assert_debug_log(timeout=60, expected_msgs=[], unexpected_msgs=ignored_file_message):
with self.nodes[0].assert_debug_log(expected_msgs=[], unexpected_msgs=ignored_file_message):
self.start_node(0, extra_args=settings + ['-noconf'])
self.stop_node(0)
@ -342,7 +342,7 @@ class ConfArgsTest(BitcoinTestFramework):
"Loaded 0 addresses from peers.dat",
"DNS seeding disabled",
"Fixed seeds are disabled",
]):
], timeout=2):
self.start_node(0, extra_args=['-dnsseed=0', '-fixedseeds=0'])
self.stop_node(0)
@ -386,7 +386,7 @@ class ConfArgsTest(BitcoinTestFramework):
# If the user did not disable -dnsseed, but it was soft-disabled because they provided -connect,
# they shouldn't see a warning about -dnsseed being ignored.
with self.nodes[0].assert_debug_log(expected_msgs=addcon_thread_started,
unexpected_msgs=dnsseed_ignored):
unexpected_msgs=dnsseed_ignored, timeout=2):
self.restart_node(0, extra_args=['-connect=fakeaddress1', UNREACHABLE_PROXY_ARG])
# We have to supply expected_msgs as it's a required argument
@ -394,7 +394,7 @@ class ConfArgsTest(BitcoinTestFramework):
# These cases test for -connect being supplied but only to disable it
for connect_arg in ['-connect=0', '-noconnect']:
with self.nodes[0].assert_debug_log(expected_msgs=addcon_thread_started,
unexpected_msgs=seednode_ignored):
unexpected_msgs=seednode_ignored, timeout=2):
self.restart_node(0, extra_args=[connect_arg, '-seednode=fakeaddress2'])
# Make sure -noconnect soft-disables -listen and -dnsseed.