AI-generated analysisPublished automatically and not human-verified. Validated context appears in community notes below.
← Watch feed
Informational 15 Bitcoin

tests: fix broken race handler in test_funding_external_wallet_corners

Public commit record

What the developer wrote

Authored by Ken Sedgwick

83/100 · Strong
tests: fix broken race handler in test_funding_external_wallet_corners

d09d0112f ("pytest: handle v fast disconnect during
test_funding_external_wallet_corners()") wrapped the reconnect in
try/except to tolerate the "disconnected during connection" race, but
the assert checks the substring against err.error, which is the whole
error dict ({'code': 402, 'message': ...}). `in` on a dict tests its
keys, so the assert fails exactly when the race it is meant to
tolerate occurs.

Seen in CI, where connect raised code 402 and the handler itself then
asserted:

E assert 'disconnected during connection' in {'code': 402,
'message': 'disconnected during connection'}

Match against err.error['message'] instead, as the equivalent handlers
in test_plugin.py and test_misc.py already do.

Changelog-None
✓ Specific, descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context✓ Mentions testing or verification
The short version

What changed, and why it matters

This is a one-line fix to a flaky automated test. The test was supposed to tolerate a harmless race condition where a peer disconnects during connection, but the assertion was checking the wrong part of the error object, so the test failed when the race actually happened. The change makes the test check the error message text instead of the dictionary keys. It does not change any production code or affect real users' funds or node security.

Recommended action

No security action required. This is a test-only reliability fix; routine merge is appropriate.

Security signals we found

No strong security signals were identified.

Risk score

Why this scored 15/100

Our methodology →
Potential impact 0/30
Exploitability 0/25
Stealth signal 0/15
Affected reach 0/15
Confidence 10/10
Evidence quality 5/5
Human-validated context

Community notes

Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.

No validated notes yet.

The AI analysis stands alone for now. Submit a note if you can add evidence or important context.