From bfcf0830ff6599e48c58db2982831a184c72b963 Mon Sep 17 00:00:00 2001 From: eugene Date: Wed, 3 Aug 2022 14:58:05 -0400 Subject: [PATCH] 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. --- htlcswitch/test_utils.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htlcswitch/test_utils.go b/htlcswitch/test_utils.go index 7cda5d97a..a4868c12f 100644 --- a/htlcswitch/test_utils.go +++ b/htlcswitch/test_utils.go @@ -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) {},