htlcswitch: fix flake in TestChannelLinkCancelFullCommitment

We bring down the max number of inflight HTLCs in the link's unit tests
to speed up the tests.
This commit is contained in:
yyforyongyu committed 2024-10-31 20:23:31 +08:00
1 parent c0e85d36ae
commit 8311bc56e5
3 files changed
+38 -52

No files matched your search

+6 -2
View File
@@ -43,6 +43,10 @@ import (
"github.com/stretchr/testify/require"
)
// maxInflightHtlcs specifies the max number of inflight HTLCs. This number is
// chosen to be smaller than the default 483 so the test can run faster.
const maxInflightHtlcs = 50
var (
alicePrivKey = []byte("alice priv key")
bobPrivKey = []byte("bob priv key")
@@ -145,7 +149,7 @@ func createTestChannel(t *testing.T, alicePrivKey, bobPrivKey []byte,
channelCapacity),
ChanReserve: aliceReserve,
MinHTLC: 0,
MaxAcceptedHtlcs: input.MaxHTLCNumber / 2,
MaxAcceptedHtlcs: maxInflightHtlcs,
}
aliceCommitParams := channeldb.CommitmentParams{
DustLimit: btcutil.Amount(200),
@@ -157,7 +161,7 @@ func createTestChannel(t *testing.T, alicePrivKey, bobPrivKey []byte,
channelCapacity),
ChanReserve: bobReserve,
MinHTLC: 0,
MaxAcceptedHtlcs: input.MaxHTLCNumber / 2,
MaxAcceptedHtlcs: maxInflightHtlcs,
}
bobCommitParams := channeldb.CommitmentParams{
DustLimit: btcutil.Amount(800),