mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-03-04 01:36:24 +01:00
htlcswitch: fix flake in TestShutdownIfChannelClean
When Alice receives a CommitSig near the end of the test, the test assumed that she wouldn't reply with a RevokeAndAck message before shutdownAssert was called. This led to a test flake. Instead, only call shutdownAssert after we've received the RevokeAndAck.
This commit is contained in:
parent
3385d38414
commit
49877545ba
1 changed files with 5 additions and 1 deletions
|
@ -6604,9 +6604,13 @@ func TestShutdownIfChannelClean(t *testing.T) {
|
|||
ctx.sendRevAndAckBobToAlice()
|
||||
shutdownAssert(ErrLinkFailedShutdown)
|
||||
|
||||
// There is currently no controllable breakpoint between Alice
|
||||
// receiving the CommitSig and her sending out the RevokeAndAck. As
|
||||
// soon as the RevokeAndAck is generated, the channel becomes clean.
|
||||
// This can happen right after the CommitSig is received, so there is
|
||||
// no shutdown assertion here.
|
||||
// <---sig-----
|
||||
ctx.sendCommitSigBobToAlice(0)
|
||||
shutdownAssert(ErrLinkFailedShutdown)
|
||||
|
||||
// ----rev---->
|
||||
ctx.receiveRevAndAckAliceToBob()
|
||||
|
|
Loading…
Add table
Reference in a new issue