lnd
lnd copied to clipboard
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.
Running with:
go test -v -tags=dev,stdlog,debug -test.timeout=4m -run TestChannelLinkCancelFullCommitment
gave debug logs which helped narrow this down
Fixes https://github.com/lightningnetwork/lnd/issues/5437