Add tests for warning messages from peers#6805
Conversation
There was a problem hiding this comment.
Fixed in the original test too 🙏
There was a problem hiding this comment.
This doesn't test the reverse. If the channel is failed although this is unexpected, the test should fail.
There was a problem hiding this comment.
totally right, i added the new test case, saw it fail (as it should) and fix it this way but in reality I wasn't testing anything 👎
Fixed in both ways with
if test.shouldFailChannel && timeout {
require.Fail(t, "expected link errors did not happen "+
"before timeout")
} else if !test.shouldFailChannel && !timeout {
require.Fail(t, "unexpected link errors happened")
}
faf1295 to
df9aec2
Compare
Add new execution path based on if we expect the channeil to fail or not. Fix format for the lines over 80 characters in the test.
Commit #7b56b67 added support for warning messages from our peers. This commit adds some testing to ensure that processing those messages don't fail the channel.
df9aec2 to
acd8262
Compare
|
This test confirms everything in the link was ok, but the root issue was that we converted the warning to an error when sending to the link in the first place: #6801 (comment) |
|
@Crypt-iQ: review reminder |
|
|
||
| // Sent a random warning message. | ||
| warning := &lnwire.Warning{ | ||
| Error: *lnwire.NewError()} |
There was a problem hiding this comment.
nit: closing brace should be on newline
|
needs rebase |
|
Close in favor of #6840 |
Change Description
Test that warning messages from our peers do not trigger any action.
Steps to Test
pushd htlcswitch && go test -v -run TestChannelLinkFail && popdPull Request Checklist
Testing
Code Style and Documentation
[skip ci]in the commit message for small changes.