Skip to content

Commit

Permalink
Fixed issues found by lint.
Browse files Browse the repository at this point in the history
Signed-off-by: Bartlomiej Plotka <bwplotka@gmail.com>
  • Loading branch information
bwplotka committed Jul 9, 2020
1 parent e3a0510 commit 025f62f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 9 deletions.
8 changes: 3 additions & 5 deletions pkg/store/multitsdb_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)()

Expand Down Expand Up @@ -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{
Expand All @@ -288,7 +288,5 @@ func TestMultiTSDBStore_NotLeakingOnPrematureFinish(t *testing.T) {
},
}))
testutil.NotOk(t, ctx.Err())
}); !ok {
return
}
})
}
6 changes: 2 additions & 4 deletions pkg/store/proxy_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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{
Expand All @@ -1716,7 +1716,5 @@ func TestProxyStore_NotLeakingOnPrematureFinish(t *testing.T) {
},
}))
testutil.NotOk(t, ctx.Err())
}); !ok {
return
}
})
}

0 comments on commit 025f62f

Please sign in to comment.