Skip to content

qa: Verify clean shutdown on startup failure

Improves handling of startup errors in functional tests and puts tests in place to ensure knock-on errors don't creep in.

  • wait_for_rpc_connection() now appends specific failures leading up to the Unable to connect to bitcoind error to that error message: [node 0] Unable to connect to bitcoind after 60s (ignored errors: {'missing_credentials': 1, 'OSError.ECONNREFUSED': 239}, latest error: ConnectionRefusedError(111, 'Connection refused'))
  • Fixes Windows Python issue where socket.timeout exceptions end up with unset errno-fields.
  • Also adds comments, refactors code, improves logging.

The underlying purpose is to ensure developer efficiency in finding root causes of test failures.

Prior iterations of the PR partially focused on fixing the same issue as #31620. Originally inspired by #30390 (closed).

Testing

Can be tested by reverting either faf2f2c6 or fae3bf6b from #31620, or the "qa: Avoid calling stop-RPC if not connected" from this PR, and running feature_framework_startup_failures.py. Checking out the commit which adds the tests before applying the reverts avoids conflicts with the last logging-change-only commit.

Merge request reports

Loading