Only close after checking for err.

This commit is contained in:
Brian Brazil 2017-10-09 17:03:33 +01:00
parent 7158675aa8
commit cc5499fcad
1 changed files with 1 additions and 1 deletions

View File

@ -191,10 +191,10 @@ func TestStaleness(t *testing.T) {
group.Eval(time.Unix(2, 0))
querier, err := storage.Querier(context.Background(), 0, 2000)
defer querier.Close()
if err != nil {
t.Fatal(err)
}
defer querier.Close()
matcher, _ := labels.NewMatcher(labels.MatchEqual, model.MetricNameLabel, "a_plus_one")
samples, err := readSeriesSet(querier.Select(matcher))
if err != nil {