From 49877545ba19a3552953600f958f4c5c15ae79ee Mon Sep 17 00:00:00 2001 From: eugene Date: Wed, 29 Sep 2021 17:04:53 -0400 Subject: [PATCH 1/2] 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. --- htlcswitch/link_test.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/htlcswitch/link_test.go b/htlcswitch/link_test.go index 1f99a1d9d..5cb97482e 100644 --- a/htlcswitch/link_test.go +++ b/htlcswitch/link_test.go @@ -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() From b0018f238723ffe202c6d6d10979c749a42d1c3c Mon Sep 17 00:00:00 2001 From: eugene Date: Wed, 29 Sep 2021 17:09:29 -0400 Subject: [PATCH 2/2] docs: update release notes for 0.14.0 --- docs/release-notes/release-notes-0.14.0.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/docs/release-notes/release-notes-0.14.0.md b/docs/release-notes/release-notes-0.14.0.md index ee748ec1a..be0c0c2b1 100644 --- a/docs/release-notes/release-notes-0.14.0.md +++ b/docs/release-notes/release-notes-0.14.0.md @@ -297,6 +297,8 @@ you. * [Order of the start/stop on subsystems are changed to promote better safety](https://github.com/lightningnetwork/lnd/pull/1783). +* [Fixed flake that occurred when testing the new optimistic link shutdown.](https://github.com/lightningnetwork/lnd/pull/5808) + ## Database * [Ensure single writer for legacy