From 294fba0bc5e6b0a28d04e780298aa457bf189974 Mon Sep 17 00:00:00 2001 From: Oliver Gugger Date: Mon, 9 Aug 2021 13:55:35 +0200 Subject: [PATCH] itest: fix channel backup subscription test With one more notification event being dispatched in the local force close case we need to update one of the integration tests to account for the additional message. --- lntest/itest/lnd_channel_backup_test.go | 23 ++++++++++++++++++----- 1 file changed, 18 insertions(+), 5 deletions(-) diff --git a/lntest/itest/lnd_channel_backup_test.go b/lntest/itest/lnd_channel_backup_test.go index 4c383bcb0..d870d802f 100644 --- a/lntest/itest/lnd_channel_backup_test.go +++ b/lntest/itest/lnd_channel_backup_test.go @@ -578,15 +578,28 @@ func testChannelBackupUpdates(net *lntest.NetworkHarness, t *harnessTest) { ctxt, t, net, net.Alice, chanPoint, forceClose, ) - // We should get a single notification after closing, and the - // on-disk state should match this latest notifications. - assertBackupNtfns(1) - assertBackupFileState() - // If we force closed the channel, then we'll mine enough // blocks to ensure all outputs have been swept. if forceClose { + // A local force closed channel will trigger a + // notification once the commitment TX confirms on + // chain. But that won't remove the channel from the + // backup just yet, that will only happen once the time + // locked contract was fully resolved on chain. + assertBackupNtfns(1) + cleanupForceClose(t, net, net.Alice, chanPoint) + + // Now that the channel's been fully resolved, we expect + // another notification. + assertBackupNtfns(1) + assertBackupFileState() + } else { + // We should get a single notification after closing, + // and the on-disk state should match this latest + // notifications. + assertBackupNtfns(1) + assertBackupFileState() } } }