test: suppress ECONNABORTED in wait_for_rpc_connection on Windows
What changed, and why it matters
This is a test-only fix for a flaky automated test on Windows. It adds one more network error code (ECONNABORTED) to the list of temporary connection errors that the test framework should ignore while waiting for a Bitcoin node to start or shut down. It does not change Bitcoin Core's production code, network behavior, or security.
No security action needed. Treat as a normal test-framework reliability improvement.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The patch modifies test/functional/test_framework/test_node.py so that ConnectionAbortedError (errno.ECONNABORTED / Windows WSAECONNABORTED) is caught and retried inside wait_for_rpc_connection(), alongside ECONNRESET, ETIMEDOUT, and ECONNREFUSED. The race occurs when the functional test starts bitcoind with -bind=1.1.1.5 on Windows CI; the node fails to bind and exits, but an RPC probe can hit an abortively closed connection before the framework detects the process exit. Suppressing the error lets the test framework notice the real failure and convert it to a SkipTest, eliminating a flaky failure.
Changed components
test/functional/test_framework/test_node.pyInspect captured patch +4 / −0
diff --git a/test/functional/test_framework/test_node.py b/test/functional/test_framework/test_node.py
index 1ba2e09b..761f4bbe 100755
--- a/test/functional/test_framework/test_node.py
+++ b/test/functional/test_framework/test_node.py
@@ -378,9 +378,13 @@ class TestNode():
# doesn't specify errno.
elif isinstance(e, ConnectionResetError):
error_num = errno.ECONNRESET
+ # Windows can raise this while bitcoind shuts down during startup.
+ elif isinstance(e, ConnectionAbortedError):
+ error_num = errno.ECONNABORTED
# Suppress similarly to the above JSONRPCException errors.
if error_num not in [
+ errno.ECONNABORTED, # Treat identical to ECONNRESET
errno.ECONNRESET, # This might happen when the RPC server is in warmup,
# but shut down before the call to getblockcount succeeds.
errno.ETIMEDOUT, # Treat identical to ECONNRESET
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.