htlcswitch/test_utils: use realistic link timeouts

This commit is contained in:
Conner Fromknecht 2018-06-30 11:43:07 -07:00
parent 10ecf2307f
commit 12f74f762d
No known key found for this signature in database
GPG Key ID: 39DE78FBE6ACB0EF

@ -878,9 +878,10 @@ func newThreeHopNetwork(t testing.TB, aliceChannel, firstBobChannel,
} }
const ( const (
batchTimeout = 50 * time.Millisecond batchTimeout = 50 * time.Millisecond
fwdPkgTimeout = 5 * time.Second fwdPkgTimeout = 5 * time.Second
feeUpdateTimeout = 30 * time.Minute minFeeUpdateTimeout = 30 * time.Minute
maxFeeUpdateTimeout = 40 * time.Minute
) )
pCache := &mockPreimageCache{ pCache := &mockPreimageCache{
@ -919,8 +920,8 @@ func newThreeHopNetwork(t testing.TB, aliceChannel, firstBobChannel,
BatchSize: 10, BatchSize: 10,
BatchTicker: &mockTicker{time.NewTicker(batchTimeout).C}, BatchTicker: &mockTicker{time.NewTicker(batchTimeout).C},
FwdPkgGCTicker: &mockTicker{time.NewTicker(fwdPkgTimeout).C}, FwdPkgGCTicker: &mockTicker{time.NewTicker(fwdPkgTimeout).C},
MinFeeUpdateTimeout: feeUpdateTimeout, MinFeeUpdateTimeout: minFeeUpdateTimeout,
MaxFeeUpdateTimeout: feeUpdateTimeout, MaxFeeUpdateTimeout: maxFeeUpdateTimeout,
OnChannelFailure: func(lnwire.ChannelID, lnwire.ShortChannelID, LinkFailureError) {}, OnChannelFailure: func(lnwire.ChannelID, lnwire.ShortChannelID, LinkFailureError) {},
}, },
aliceChannel, aliceChannel,
@ -962,8 +963,8 @@ func newThreeHopNetwork(t testing.TB, aliceChannel, firstBobChannel,
BatchSize: 10, BatchSize: 10,
BatchTicker: &mockTicker{time.NewTicker(batchTimeout).C}, BatchTicker: &mockTicker{time.NewTicker(batchTimeout).C},
FwdPkgGCTicker: &mockTicker{time.NewTicker(fwdPkgTimeout).C}, FwdPkgGCTicker: &mockTicker{time.NewTicker(fwdPkgTimeout).C},
MinFeeUpdateTimeout: feeUpdateTimeout, MinFeeUpdateTimeout: minFeeUpdateTimeout,
MaxFeeUpdateTimeout: feeUpdateTimeout, MaxFeeUpdateTimeout: maxFeeUpdateTimeout,
OnChannelFailure: func(lnwire.ChannelID, lnwire.ShortChannelID, LinkFailureError) {}, OnChannelFailure: func(lnwire.ChannelID, lnwire.ShortChannelID, LinkFailureError) {},
}, },
firstBobChannel, firstBobChannel,
@ -1005,8 +1006,8 @@ func newThreeHopNetwork(t testing.TB, aliceChannel, firstBobChannel,
BatchSize: 10, BatchSize: 10,
BatchTicker: &mockTicker{time.NewTicker(batchTimeout).C}, BatchTicker: &mockTicker{time.NewTicker(batchTimeout).C},
FwdPkgGCTicker: &mockTicker{time.NewTicker(fwdPkgTimeout).C}, FwdPkgGCTicker: &mockTicker{time.NewTicker(fwdPkgTimeout).C},
MinFeeUpdateTimeout: feeUpdateTimeout, MinFeeUpdateTimeout: minFeeUpdateTimeout,
MaxFeeUpdateTimeout: feeUpdateTimeout, MaxFeeUpdateTimeout: maxFeeUpdateTimeout,
OnChannelFailure: func(lnwire.ChannelID, lnwire.ShortChannelID, LinkFailureError) {}, OnChannelFailure: func(lnwire.ChannelID, lnwire.ShortChannelID, LinkFailureError) {},
}, },
secondBobChannel, secondBobChannel,
@ -1048,8 +1049,8 @@ func newThreeHopNetwork(t testing.TB, aliceChannel, firstBobChannel,
BatchSize: 10, BatchSize: 10,
BatchTicker: &mockTicker{time.NewTicker(batchTimeout).C}, BatchTicker: &mockTicker{time.NewTicker(batchTimeout).C},
FwdPkgGCTicker: &mockTicker{time.NewTicker(fwdPkgTimeout).C}, FwdPkgGCTicker: &mockTicker{time.NewTicker(fwdPkgTimeout).C},
MinFeeUpdateTimeout: feeUpdateTimeout, MinFeeUpdateTimeout: minFeeUpdateTimeout,
MaxFeeUpdateTimeout: feeUpdateTimeout, MaxFeeUpdateTimeout: maxFeeUpdateTimeout,
OnChannelFailure: func(lnwire.ChannelID, lnwire.ShortChannelID, LinkFailureError) {}, OnChannelFailure: func(lnwire.ChannelID, lnwire.ShortChannelID, LinkFailureError) {},
}, },
carolChannel, carolChannel,