Merge bitcoin/bitcoin#35350: test: suppress ECONNABORTED in wait_for_rpc_connection on Windows

7209eb7790 test: suppress ECONNABORTED in wait_for_rpc_connection on Windows (Ryan Ofsky)

Pull request description:

  Since bitcoin/bitcoin#33362, `feature_bind_port_externalip.py` auto-detects whether 1.1.1.5 is available by starting a node with `-bind=1.1.1.5` and converting a bind failure into a skip. On Windows CI the address is not configured, so bitcoind exits as expected — but intermittently an RPC probe raises `ConnectionAbortedError` (WSAECONNABORTED/WinError 10053) while the process is shutting down, causing the test to fail rather than skip.

  Fix by treating ECONNABORTED the same as the other transient connection errors already suppressed during startup (ECONNRESET, ETIMEDOUT, ECONNREFUSED).

  Fixes #35343

ACKs for top commit:
  maflcko:
    lgtm ACK 7209eb7790
  willcl-ark:
    utACK 7209eb7790
  hodlinator:
    crACK 7209eb7790

Tree-SHA512: 04cf70a2d9247b32e9302827911b0d00a41aa4ac3cf0ba7a9c2aa86009019b14b3f914a3049e08b66b45ccd00530a77129aecf14a953007d28d3322f5ca16a70
This commit is contained in:
merge-script
2026-05-21 22:45:32 +02:00

View File

@@ -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