mirror of
https://github.com/prometheus/prometheus
synced 2025-03-21 18:56:38 +00:00
tsdb tests: avoid 'defer' till end of function
'defer' only runs at the end of the function, so explicitly close the querier after we finish with it. Also check it didn't error. Signed-off-by: Bryan Boreham <bjboreham@gmail.com>
This commit is contained in:
parent
2f615a200d
commit
6ba25ba93f
@ -1594,7 +1594,6 @@ func TestDelete_e2e(t *testing.T) {
|
||||
for i := 0; i < numRanges; i++ {
|
||||
q, err := NewBlockQuerier(hb, 0, 100000)
|
||||
require.NoError(t, err)
|
||||
defer q.Close()
|
||||
ss := q.Select(context.Background(), true, nil, del.ms...)
|
||||
// Build the mockSeriesSet.
|
||||
matchedSeries := make([]storage.Series, 0, len(matched))
|
||||
@ -1635,6 +1634,7 @@ func TestDelete_e2e(t *testing.T) {
|
||||
}
|
||||
require.NoError(t, ss.Err())
|
||||
require.Empty(t, ss.Warnings())
|
||||
require.NoError(t, q.Close())
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user