tests: fix broken race handler in test_funding_external_wallet_corners#9300
Open
ksedgwic wants to merge 1 commit into
Open
tests: fix broken race handler in test_funding_external_wallet_corners#9300ksedgwic wants to merge 1 commit into
ksedgwic wants to merge 1 commit into
Conversation
d09d011 ("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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Observed on a CI run for #9299 (First Integration Tests 2/6):
https://github.com/ElementsProject/lightning/actions/runs/29044319311
The test anticipates the "disconnected during connection" reconnect
race (there is a FIXME comment about it) and wraps the connect in
try/except, added in d09d011. But the handler asserts the substring
against err.error, which is the whole error dict --
inon a dicttests its keys -- so the assert fails exactly when the race it is
meant to tolerate occurs:
The handler has never worked since it was introduced in 2023; the fix
matches against err.error['message'] instead, the same form the
equivalent handlers in test_plugin.py and test_misc.py already use.