From 2b729a78f3e95dd99a1b2dbffeef37802ea4cff7 Mon Sep 17 00:00:00 2001 From: Andras Banki-Horvath Date: Tue, 14 Apr 2020 18:17:28 +0200 Subject: [PATCH] lntest: fix ticker leak --- lntest/harness.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lntest/harness.go b/lntest/harness.go index 045fd4780..c0bf7b363 100644 --- a/lntest/harness.go +++ b/lntest/harness.go @@ -211,12 +211,13 @@ func (n *NetworkHarness) SetUp(lndArgs []string) error { // Now block until both wallets have fully synced up. expectedBalance := int64(btcutil.SatoshiPerBitcoin * 10) balReq := &lnrpc.WalletBalanceRequest{} - balanceTicker := time.Tick(time.Millisecond * 50) + balanceTicker := time.NewTicker(time.Millisecond * 50) + defer balanceTicker.Stop() balanceTimeout := time.After(time.Second * 30) out: for { select { - case <-balanceTicker: + case <-balanceTicker.C: aliceResp, err := n.Alice.WalletBalance(ctxb, balReq) if err != nil { return err