Skip to content

Commit 0046505

Browse files
committed
itest: custom channels flakes fixes
1 parent 9d3f02e commit 0046505

File tree

1 file changed

+17
-3
lines changed

1 file changed

+17
-3
lines changed

itest/litd_custom_channels_test.go

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,9 @@ var (
9999
)
100100

101101
const (
102-
fundingAmount = 50_000
102+
fundingAmount = 50_000
103+
eventuallyTimeout = time.Second * 30
104+
eventuallyTicker = time.Millisecond * 250
103105
)
104106

105107
// testCustomChannels tests that we can create a network with custom channels
@@ -386,7 +388,7 @@ func testCustomChannels(_ context.Context, net *NetworkHarness,
386388
// ------------
387389
// Test case 1: Send a direct keysend payment from Charlie to Dave.
388390
// ------------
389-
const keySendAmount = 100
391+
const keySendAmount = 1000
390392
sendAssetKeySendPayment(
391393
t.t, charlie, dave, keySendAmount, assetID, fn.None[int64](),
392394
)
@@ -395,6 +397,12 @@ func testCustomChannels(_ context.Context, net *NetworkHarness,
395397
charlieAssetBalance -= keySendAmount
396398
daveAssetBalance += keySendAmount
397399

400+
require.Eventually(t.t, func() bool {
401+
local, _ := getAssetChannelBalance(t.t, dave, assetID, false)
402+
403+
return local == daveAssetBalance
404+
}, eventuallyTimeout, eventuallyTicker)
405+
398406
// We should be able to send the 100 assets back immediately, because
399407
// there is enough on-chain balance on Dave's side to be able to create
400408
// an HTLC.
@@ -930,7 +938,7 @@ func testCustomChannelsGroupedAsset(_ context.Context, net *NetworkHarness,
930938
// ------------
931939
// Test case 1: Send a direct keysend payment from Charlie to Dave.
932940
// ------------
933-
const keySendAmount = 100
941+
const keySendAmount = 1000
934942
sendAssetKeySendPayment(
935943
t.t, charlie, dave, keySendAmount, assetID, fn.None[int64](),
936944
)
@@ -939,6 +947,12 @@ func testCustomChannelsGroupedAsset(_ context.Context, net *NetworkHarness,
939947
charlieAssetBalance -= keySendAmount
940948
daveAssetBalance += keySendAmount
941949

950+
require.Eventually(t.t, func() bool {
951+
local, _ := getAssetChannelBalance(t.t, dave, assetID, false)
952+
953+
return local == daveAssetBalance
954+
}, eventuallyTimeout, eventuallyTicker)
955+
942956
// We should be able to send the 100 assets back immediately, because
943957
// there is enough on-chain balance on Dave's side to be able to create
944958
// an HTLC.

0 commit comments

Comments
 (0)