From 025f62fea62e8ed6f4ae3e0cb263fce5cda7f817 Mon Sep 17 00:00:00 2001 From: Bartlomiej Plotka Date: Thu, 9 Jul 2020 10:28:22 +0100 Subject: [PATCH] Fixed issues found by lint. Signed-off-by: Bartlomiej Plotka --- pkg/store/multitsdb_test.go | 8 +++----- pkg/store/proxy_test.go | 6 ++---- 2 files changed, 5 insertions(+), 9 deletions(-) diff --git a/pkg/store/multitsdb_test.go b/pkg/store/multitsdb_test.go index f5d7d812ed8..d3daa5f79f4 100644 --- a/pkg/store/multitsdb_test.go +++ b/pkg/store/multitsdb_test.go @@ -243,7 +243,7 @@ func (s *mockedSeriesServer) Send(r *storepb.SeriesResponse) error { func (s *mockedSeriesServer) Context() context.Context { return s.ctx } // Regression test against https://github.com/thanos-io/thanos/issues/2823. -// This is different leak than in TestTenantSeriesSetServert_NotLeakingIfNotExhausted +// This is different leak than in TestTenantSeriesSetServert_NotLeakingIfNotExhausted. func TestMultiTSDBStore_NotLeakingOnPrematureFinish(t *testing.T) { defer leaktest.CheckTimeout(t, 10*time.Second)() @@ -277,7 +277,7 @@ func TestMultiTSDBStore_NotLeakingOnPrematureFinish(t *testing.T) { } }) - if ok := t.Run("failing send", func(t *testing.T) { + t.Run("failing send", func(t *testing.T) { ctx, cancel := context.WithCancel(context.Background()) // We mimic failing series server, but practically context cancel will do the same. testutil.NotOk(t, m.Series(&storepb.SeriesRequest{PartialResponseStrategy: storepb.PartialResponseStrategy_ABORT}, &mockedSeriesServer{ @@ -288,7 +288,5 @@ func TestMultiTSDBStore_NotLeakingOnPrematureFinish(t *testing.T) { }, })) testutil.NotOk(t, ctx.Err()) - }); !ok { - return - } + }) } diff --git a/pkg/store/proxy_test.go b/pkg/store/proxy_test.go index 074a6cc85d0..50019ced37e 100644 --- a/pkg/store/proxy_test.go +++ b/pkg/store/proxy_test.go @@ -1705,7 +1705,7 @@ func TestProxyStore_NotLeakingOnPrematureFinish(t *testing.T) { responseTimeout: 0, } - if ok := t.Run("failling send", func(t *testing.T) { + t.Run("failling send", func(t *testing.T) { ctx, cancel := context.WithCancel(context.Background()) // We mimic failing series server, but practically context cancel will do the same. testutil.NotOk(t, p.Series(&storepb.SeriesRequest{Matchers: []storepb.LabelMatcher{{}}, PartialResponseStrategy: storepb.PartialResponseStrategy_ABORT}, &mockedSeriesServer{ @@ -1716,7 +1716,5 @@ func TestProxyStore_NotLeakingOnPrematureFinish(t *testing.T) { }, })) testutil.NotOk(t, ctx.Err()) - }); !ok { - return - } + }) }