htlcswitch: use ticker.New instead of NewForce for test link

NewForce's Pause method doesn't reset the ticker, so a test flake
would occur in TestChannelLinkCancelFullCommitment where
PendingCommitTicker.Pause() was called, but the underlying timer was
still ticking. When PendingCommitTicker.Resume() was called, an
unlucky Ticks() call could end up firing, leading to the link being
shut down.
This commit is contained in:
eugene 2022-08-03 14:58:05 -04:00
parent 49eeabf2a4
commit bfcf0830ff
No known key found for this signature in database
GPG key ID: 118759E83439A9B1

View file

@ -1166,7 +1166,7 @@ func (h *hopNetwork) createChannelLink(server, peer *mockServer,
BatchSize: 10,
BatchTicker: ticker.NewForce(testBatchTimeout),
FwdPkgGCTicker: ticker.NewForce(fwdPkgTimeout),
PendingCommitTicker: ticker.NewForce(2 * time.Minute),
PendingCommitTicker: ticker.New(2 * time.Minute),
MinFeeUpdateTimeout: minFeeUpdateTimeout,
MaxFeeUpdateTimeout: maxFeeUpdateTimeout,
OnChannelFailure: func(lnwire.ChannelID, lnwire.ShortChannelID, LinkFailureError) {},