Merge pull request #5808 from Crypt-iQ/shutdown_clean_flakefix_0929

htlcswitch: fix flake in TestShutdownIfChannelClean
This commit is contained in:
Olaoluwa Osuntokun authored and GitHub committed 2021-09-29 17:43:09 -07:00
commit 34cb9357ee
2 files changed
+7 -1

No files matched your search

@@ -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). * [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 ## Database
* [Ensure single writer for legacy * [Ensure single writer for legacy
+5 -1
View File
@@ -6604,9 +6604,13 @@ func TestShutdownIfChannelClean(t *testing.T) {
ctx.sendRevAndAckBobToAlice() ctx.sendRevAndAckBobToAlice()
shutdownAssert(ErrLinkFailedShutdown) 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----- // <---sig-----
ctx.sendCommitSigBobToAlice(0) ctx.sendCommitSigBobToAlice(0)
shutdownAssert(ErrLinkFailedShutdown)
// ----rev----> // ----rev---->
ctx.receiveRevAndAckAliceToBob() ctx.receiveRevAndAckAliceToBob()