-
Notifications
You must be signed in to change notification settings - Fork 2.2k
lnwallet/chancloser: fix flake in TestRbfCloseClosingNegotiationLocal #9652
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
lnwallet/chancloser: fix flake in TestRbfCloseClosingNegotiationLocal #9652
Conversation
|
Important Review skippedAuto reviews are limited to specific labels. 🏷️ Labels to auto review (1)
Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR addresses a test flake in the RBF loop for the TestRbfCloseClosingNegotiationLocal by introducing an iteration flag to better track state transitions during iterations.
- Adds an iteration boolean parameter to the functions expectHalfSignerIteration and assertSingleRbfIteration.
- Updates test calls to pass the correct iteration flag.
|
Looks like this revealed another flake: Will look into it. |
In this commit, we fix a flake in the rbf loop sub-test for the TestRbfCloseClosingNegotiationLocal test case. The fix here is that when we go from ClosePending for an RBF iteration loop, we first transition to LocalCloseStart. However we only do this extra transition if we're doing an iteration (starting from ClosePending). To fix this, we add a new bool that tracks if this is an iteration or not. We can then also eliminate the extra assertion at the end, as we'll terminate in `ClosePending` which is checked by `assertLocalClosePending()` in `assertSingleRbfIteration`. Fixes lightningnetwork#9526.
67e9826 to
40f58da
Compare
|
I think that was a flake that was fixed in my other PR. Pushed up a rebased version. |
yyforyongyu
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the fix! Looks like we have one more flake tho,
--- FAIL: TestRbfCloseClosingNegotiationLocal (0.04s)
--- FAIL: TestRbfCloseClosingNegotiationLocal/send_offer_rbf_wrong_local_script (0.00s)
rbf_coop_test.go:1565: FAIL: ReportError(mock.argumentMatcher)
at: [/home/runner/work/lnd/lnd/lnwallet/chancloser/rbf_coop_test.go:398 /home/runner/work/lnd/lnd/lnwallet/chancloser/rbf_coop_test.go:1548]
rbf_coop_test.go:1565: FAIL: 0 out of 1 expectation(s) were met.
The code you are testing needs to make 1 more call(s).
at: [/home/runner/work/lnd/lnd/lnwallet/chancloser/rbf_coop_test.go:238 /home/runner/work/lnd/lnd/lnwallet/chancloser/rbf_coop_test.go:248 /home/runner/work/lnd/lnd/lnwallet/chancloser/rbf_coop_test.go:1565]
FAIL
FAIL github.com/lightningnetwork/lnd/lnwallet/chancloser 0.505s
FAIL
|
Hmm yeah I think this fix exposed some other ones. I think the issue is mainly with the way the test framework does the assertions. I'll do a pass to try to make the state assertions more precise. |
|
@Roasbeef, remember to re-request review from reviewers when ready |
…l/send_offer_rbf_wrong_local_script In this commit, we fix a flake in the `TestRbfCloseClosingNegotiationLocal/send_offer_rbf_wrong_local_script` test. This flake can happen if the test shuts down _before_ the state machine is actually able to process the sent event. In this case, the expectations are triggered, and we find that the error isn't sent. To resolve this, we create a new wrapper function that'll use a sync channel send to assert that the error has been sent before we exit the test.
|
Pushed up a commit to attempt to fix the latest concurrency related flake. |
yyforyongyu
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you!
In this commit, we fix a flake in the rbf loop sub-test for the TestRbfCloseClosingNegotiationLocal test case.
The fix here is that when we go from ClosePending for an RBF iteration loop, we first transition to LocalCloseStart. However we only do this extra transition if we're doing an iteration (starting from ClosePending).
To fix this, we add a new bool that tracks if this is an iteration or not. We can then also eliminate the extra assertion at the end, as we'll terminate in
ClosePendingwhich is checked byassertLocalClosePending()inassertSingleRbfIteration.Fixes #9526.