From dc6472820c4c5bfd561f35f1990ca87900f95335 Mon Sep 17 00:00:00 2001 From: gfanton <8671905+gfanton@users.noreply.github.com> Date: Wed, 10 Jan 2024 15:57:45 +0100 Subject: [PATCH] chore: lint Signed-off-by: gfanton <8671905+gfanton@users.noreply.github.com> --- tm2/pkg/bft/consensus/common_test.go | 7 +++---- tm2/pkg/bft/consensus/state_test.go | 2 -- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/tm2/pkg/bft/consensus/common_test.go b/tm2/pkg/bft/consensus/common_test.go index 4f9dd0db7c6..68f28795256 100644 --- a/tm2/pkg/bft/consensus/common_test.go +++ b/tm2/pkg/bft/consensus/common_test.go @@ -815,13 +815,13 @@ func newPersistentKVStoreWithPath(dbDir string) abci.Application { // ------------------------------------ func ensureDrainedChannels(t *testing.T, channels ...any) { + t.Helper() + r := recover() if r == nil { return } - t.Helper() - t.Logf("checking for drained channel") leaks := make(map[string]int) for _, ch := range channels { @@ -848,8 +848,7 @@ func ensureDrainedChannels(t *testing.T, channels ...any) { } for leak, count := range leaks { - fmt.Printf("channel %q: %d events left\n", leak, count) - // assert.Fail(t, "event leak", "channel %q: %d events left", leak, count) + t.Logf("channel %q: %d events left\n", leak, count) } panic(r) diff --git a/tm2/pkg/bft/consensus/state_test.go b/tm2/pkg/bft/consensus/state_test.go index 12af229c443..cbd93196af5 100644 --- a/tm2/pkg/bft/consensus/state_test.go +++ b/tm2/pkg/bft/consensus/state_test.go @@ -165,7 +165,6 @@ func TestStateEnterProposeNoPrivValidator(t *testing.T) { if ensureGetRoundState(cs).Proposal != nil { t.Error("Expected to make no proposal, since no privValidator") } - } // a validator should not timeout of the prevote round (TODO: unless the block is really big!) @@ -309,7 +308,6 @@ func TestStateFullRound1(t *testing.T) { ensureNewRound(newRoundCh, height+1, 0) validateLastPrecommit(cs, vss[0], propBlockHash) - } // nil is proposed, so prevote and precommit nil