itest+lntest: remove temporary hacks around broken coop close in itests

This commit is contained in:
Keagan McClelland 2024-01-16 16:00:17 -08:00
parent 9e58ebd0fb
commit 07277172f8
6 changed files with 9 additions and 84 deletions

View file

@ -309,15 +309,6 @@ func (m *mppTestScenario) closeChannels() {
return
}
// TODO(yy): remove the sleep once the following bug is fixed. When the
// payment is reported as settled by Alice, it's expected the
// commitment dance is finished and all subsequent states have been
// updated. Yet we'd receive the error `cannot co-op close channel with
// active htlcs` or `link failed to shutdown` if we close the channel.
// We need to investigate the order of settling the payments and
// updating commitments to understand and fix .
time.Sleep(5 * time.Second)
// Close all channels without mining the closing transactions.
m.ht.CloseChannelAssertPending(m.alice, m.channelPoints[0], false)
m.ht.CloseChannelAssertPending(m.alice, m.channelPoints[1], false)

View file

@ -312,15 +312,6 @@ func runPsbtChanFunding(ht *lntest.HarnessTest, carol, dave *node.HarnessNode,
resp := dave.RPC.AddInvoice(invoice)
ht.CompletePaymentRequests(carol, []string{resp.PaymentRequest})
// TODO(yy): remove the sleep once the following bug is fixed. When the
// payment is reported as settled by Carol, it's expected the
// commitment dance is finished and all subsequent states have been
// updated. Yet we'd receive the error `cannot co-op close channel with
// active htlcs` or `link failed to shutdown` if we close the channel.
// We need to investigate the order of settling the payments and
// updating commitments to understand and fix .
time.Sleep(2 * time.Second)
// To conclude, we'll close the newly created channel between Carol and
// Dave. This function will also block until the channel is closed and
// will additionally assert the relevant channel closing post
@ -496,15 +487,6 @@ func runPsbtChanFundingExternal(ht *lntest.HarnessTest, carol,
resp := dave.RPC.AddInvoice(invoice)
ht.CompletePaymentRequests(carol, []string{resp.PaymentRequest})
// TODO(yy): remove the sleep once the following bug is fixed. When the
// payment is reported as settled by Carol, it's expected the
// commitment dance is finished and all subsequent states have been
// updated. Yet we'd receive the error `cannot co-op close channel with
// active htlcs` or `link failed to shutdown` if we close the channel.
// We need to investigate the order of settling the payments and
// updating commitments to understand and fix .
time.Sleep(2 * time.Second)
// To conclude, we'll close the newly created channel between Carol and
// Dave. This function will also block until the channels are closed and
// will additionally assert the relevant channel closing post
@ -656,15 +638,6 @@ func runPsbtChanFundingSingleStep(ht *lntest.HarnessTest, carol,
resp := dave.RPC.AddInvoice(invoice)
ht.CompletePaymentRequests(carol, []string{resp.PaymentRequest})
// TODO(yy): remove the sleep once the following bug is fixed. When the
// payment is reported as settled by Carol, it's expected the
// commitment dance is finished and all subsequent states have been
// updated. Yet we'd receive the error `cannot co-op close channel with
// active htlcs` or `link failed to shutdown` if we close the channel.
// We need to investigate the order of settling the payments and
// updating commitments to understand and fix .
time.Sleep(2 * time.Second)
// To conclude, we'll close the newly created channel between Carol and
// Dave. This function will also block until the channel is closed and
// will additionally assert the relevant channel closing post

View file

@ -1323,15 +1323,6 @@ func testRouteFeeCutoff(ht *lntest.HarnessTest) {
}
testFeeCutoff(feeLimitFixed)
// TODO(yy): remove the sleep once the following bug is fixed. When the
// payment is reported as settled by Carol, it's expected the
// commitment dance is finished and all subsequent states have been
// updated. Yet we'd receive the error `cannot co-op close channel with
// active htlcs` or `link failed to shutdown` if we close the channel.
// We need to investigate the order of settling the payments and
// updating commitments to understand and fix .
time.Sleep(2 * time.Second)
// Once we're done, close the channels and shut down the nodes created
// throughout this test.
ht.CloseChannel(alice, chanPointAliceBob)

View file

@ -426,15 +426,6 @@ func fundChanAndCloseFromImportedAccount(ht *lntest.HarnessTest, srcNode,
ht.CompletePaymentRequests(srcNode, []string{resp.PaymentRequest})
// TODO(yy): remove the sleep once the following bug is fixed. When the
// payment is reported as settled by srcNode, it's expected the
// commitment dance is finished and all subsequent states have been
// updated. Yet we'd receive the error `cannot co-op close channel with
// active htlcs` or `link failed to shutdown` if we close the channel.
// We need to investigate the order of settling the payments and
// updating commitments to understand and fix .
time.Sleep(2 * time.Second)
// Now that we've confirmed the opened channel works, we'll close it.
ht.CloseChannel(srcNode, chanPoint)

View file

@ -865,15 +865,6 @@ func testOptionScidUpgrade(ht *lntest.HarnessTest) {
daveInvoice2 := dave.RPC.AddInvoice(daveParams)
ht.CompletePaymentRequests(bob, []string{daveInvoice2.PaymentRequest})
// TODO(yy): remove the sleep once the following bug is fixed. When
// the payment is reported as settled by Bob, it's expected the
// commitment dance is finished and all subsequent states have been
// updated. Yet we'd receive the error `cannot co-op close channel with
// active htlcs` or `link failed to shutdown` if we close the channel.
// We need to investigate the order of settling the payments and
// updating commitments to understand and fix.
time.Sleep(2 * time.Second)
// Close standby node's channels.
ht.CloseChannel(bob, fundingPoint2)
}

View file

@ -1207,6 +1207,7 @@ func (h *HarnessTest) CloseChannelAssertPending(hn *node.HarnessNode,
closeReq := &lnrpc.CloseChannelRequest{
ChannelPoint: cp,
Force: force,
NoWait: true,
}
var (
@ -1218,28 +1219,15 @@ func (h *HarnessTest) CloseChannelAssertPending(hn *node.HarnessNode,
// Consume the "channel close" update in order to wait for the closing
// transaction to be broadcast, then wait for the closing tx to be seen
// within the network.
//
// TODO(yy): remove the wait once the following bug is fixed.
// - https://github.com/lightningnetwork/lnd/issues/6039
// We may receive the error `cannot co-op close channel with active
// htlcs` or `link failed to shutdown` if we close the channel. We need
// to investigate the order of settling the payments and updating
// commitments to properly fix it.
err = wait.NoError(func() error {
stream = hn.RPC.CloseChannel(closeReq)
event, err = h.ReceiveCloseChannelUpdate(stream)
if err != nil {
h.Logf("Test: %s, close channel got error: %v",
h.manager.currentTestCase, err)
stream = hn.RPC.CloseChannel(closeReq)
_, err = h.ReceiveCloseChannelUpdate(stream)
require.NoError(h, err, "close channel update got error: %v", err)
// NoError predicates every 200ms, which is too
// frequent for closing channels. We sleep here to
// avoid trying it too much.
time.Sleep(2 * time.Second)
}
return err
}, wait.ChannelCloseTimeout)
event, err = h.ReceiveCloseChannelUpdate(stream)
if err != nil {
h.Logf("Test: %s, close channel got error: %v",
h.manager.currentTestCase, err)
}
require.NoError(h, err, "retry closing channel failed")
pendingClose, ok := event.Update.(*lnrpc.CloseStatusUpdate_ClosePending)