test: Fixup assert_debug_log timeouts in feature_config_args.py
What changed, and why it matters
This is a minor test-only change in Bitcoin Core's own test suite. It adjusts how long the tests wait for certain log messages to appear, removing unnecessary waits for some checks and adding short waits for others. It does not change the Bitcoin software that users run and has no security impact.
No action needed. This is a test-only maintenance commit with no security relevance.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The commit modifies test/functional/feature_config_args.py only. It removes the explicit timeout=60 parameter from two assert_debug_log calls where logging occurs synchronously during node startup, and adds timeout=2 to three assert_debug_log calls where the log messages may come from network threads that start asynchronously. This is a test reliability/robustness fix, not a product code change.
Changed components
test/functional/feature_config_args.pyInspect captured patch +5 / −5
diff --git a/test/functional/feature_config_args.py b/test/functional/feature_config_args.py
index 2e515842..feca0f16 100755
--- a/test/functional/feature_config_args.py
+++ b/test/functional/feature_config_args.py
@@ -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.
Why this scored 15/100
Community notes
Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.
The AI analysis stands alone for now. Submit a note if you can add evidence or important context.