lnd icon indicating copy to clipboard operation
lnd copied to clipboard

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

Open Crypt-iQ opened this issue 3 years ago • 0 comments

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

Crypt-iQ avatar Aug 03 '22 19:08 Crypt-iQ