itest: fix and document flake in sweeping tests

We previously didn't see this issue because we always have nodes being
over-funded.
This commit is contained in:
yyforyongyu 2024-10-31 06:11:06 +08:00
parent 9f764c25f9
commit 782edde213
No known key found for this signature in database
GPG Key ID: 9BCD95C4FF296868

View File

@ -113,6 +113,14 @@ func testSweepCPFPAnchorOutgoingTimeout(ht *lntest.HarnessTest) {
ht.FundCoins(btcutil.SatoshiPerBitcoin, bob)
}
// Bob should have enough wallet UTXOs here to sweep the HTLC in the
// end of this test. However, due to a known issue, Bob's wallet may
// report there's no UTXO available. For details,
// - https://github.com/lightningnetwork/lnd/issues/8786
//
// TODO(yy): remove this step once the issue is resolved.
ht.FundCoins(btcutil.SatoshiPerBitcoin, bob)
// Subscribe the invoice.
streamCarol := carol.RPC.SubscribeSingleInvoice(payHash[:])
@ -432,6 +440,14 @@ func testSweepCPFPAnchorIncomingTimeout(ht *lntest.HarnessTest) {
ht.FundCoins(btcutil.SatoshiPerBitcoin, bob)
}
// Bob should have enough wallet UTXOs here to sweep the HTLC in the
// end of this test. However, due to a known issue, Bob's wallet may
// report there's no UTXO available. For details,
// - https://github.com/lightningnetwork/lnd/issues/8786
//
// TODO(yy): remove this step once the issue is resolved.
ht.FundCoins(btcutil.SatoshiPerBitcoin, bob)
// Subscribe the invoice.
streamCarol := carol.RPC.SubscribeSingleInvoice(payHash[:])
@ -766,6 +782,14 @@ func testSweepHTLCs(ht *lntest.HarnessTest) {
ht.FundCoins(btcutil.SatoshiPerBitcoin, bob)
ht.FundCoins(btcutil.SatoshiPerBitcoin, bob)
// Bob should have enough wallet UTXOs here to sweep the HTLC in the
// end of this test. However, due to a known issue, Bob's wallet may
// report there's no UTXO available. For details,
// - https://github.com/lightningnetwork/lnd/issues/8786
//
// TODO(yy): remove this step once the issue is resolved.
ht.FundCoins(btcutil.SatoshiPerBitcoin, bob)
// For neutrino backend, we need two more UTXOs for Bob to create his
// sweeping txns.
if ht.IsNeutrinoBackend() {