From 12f74f762d48e4dd5529609f26af5d3e68708aea Mon Sep 17 00:00:00 2001 From: Conner Fromknecht Date: Sat, 30 Jun 2018 11:43:07 -0700 Subject: [PATCH] htlcswitch/test_utils: use realistic link timeouts --- htlcswitch/test_utils.go | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/htlcswitch/test_utils.go b/htlcswitch/test_utils.go index 56af3f90..6cb2740c 100644 --- a/htlcswitch/test_utils.go +++ b/htlcswitch/test_utils.go @@ -878,9 +878,10 @@ func newThreeHopNetwork(t testing.TB, aliceChannel, firstBobChannel, } const ( - batchTimeout = 50 * time.Millisecond - fwdPkgTimeout = 5 * time.Second - feeUpdateTimeout = 30 * time.Minute + batchTimeout = 50 * time.Millisecond + fwdPkgTimeout = 5 * time.Second + minFeeUpdateTimeout = 30 * time.Minute + maxFeeUpdateTimeout = 40 * time.Minute ) pCache := &mockPreimageCache{ @@ -919,8 +920,8 @@ func newThreeHopNetwork(t testing.TB, aliceChannel, firstBobChannel, BatchSize: 10, BatchTicker: &mockTicker{time.NewTicker(batchTimeout).C}, FwdPkgGCTicker: &mockTicker{time.NewTicker(fwdPkgTimeout).C}, - MinFeeUpdateTimeout: feeUpdateTimeout, - MaxFeeUpdateTimeout: feeUpdateTimeout, + MinFeeUpdateTimeout: minFeeUpdateTimeout, + MaxFeeUpdateTimeout: maxFeeUpdateTimeout, OnChannelFailure: func(lnwire.ChannelID, lnwire.ShortChannelID, LinkFailureError) {}, }, aliceChannel, @@ -962,8 +963,8 @@ func newThreeHopNetwork(t testing.TB, aliceChannel, firstBobChannel, BatchSize: 10, BatchTicker: &mockTicker{time.NewTicker(batchTimeout).C}, FwdPkgGCTicker: &mockTicker{time.NewTicker(fwdPkgTimeout).C}, - MinFeeUpdateTimeout: feeUpdateTimeout, - MaxFeeUpdateTimeout: feeUpdateTimeout, + MinFeeUpdateTimeout: minFeeUpdateTimeout, + MaxFeeUpdateTimeout: maxFeeUpdateTimeout, OnChannelFailure: func(lnwire.ChannelID, lnwire.ShortChannelID, LinkFailureError) {}, }, firstBobChannel, @@ -1005,8 +1006,8 @@ func newThreeHopNetwork(t testing.TB, aliceChannel, firstBobChannel, BatchSize: 10, BatchTicker: &mockTicker{time.NewTicker(batchTimeout).C}, FwdPkgGCTicker: &mockTicker{time.NewTicker(fwdPkgTimeout).C}, - MinFeeUpdateTimeout: feeUpdateTimeout, - MaxFeeUpdateTimeout: feeUpdateTimeout, + MinFeeUpdateTimeout: minFeeUpdateTimeout, + MaxFeeUpdateTimeout: maxFeeUpdateTimeout, OnChannelFailure: func(lnwire.ChannelID, lnwire.ShortChannelID, LinkFailureError) {}, }, secondBobChannel, @@ -1048,8 +1049,8 @@ func newThreeHopNetwork(t testing.TB, aliceChannel, firstBobChannel, BatchSize: 10, BatchTicker: &mockTicker{time.NewTicker(batchTimeout).C}, FwdPkgGCTicker: &mockTicker{time.NewTicker(fwdPkgTimeout).C}, - MinFeeUpdateTimeout: feeUpdateTimeout, - MaxFeeUpdateTimeout: feeUpdateTimeout, + MinFeeUpdateTimeout: minFeeUpdateTimeout, + MaxFeeUpdateTimeout: maxFeeUpdateTimeout, OnChannelFailure: func(lnwire.ChannelID, lnwire.ShortChannelID, LinkFailureError) {}, }, carolChannel,