diff --git a/storage/metric/tiered.go b/storage/metric/tiered.go index 2ba080e68..570da0667 100644 --- a/storage/metric/tiered.go +++ b/storage/metric/tiered.go @@ -179,7 +179,7 @@ func (t *tieredStorage) Serve() { case drainingDone := <-t.draining: t.flush() drainingDone <- true - break + return } } } diff --git a/storage/metric/tiered_test.go b/storage/metric/tiered_test.go index fbd9143b1..070bc4565 100644 --- a/storage/metric/tiered_test.go +++ b/storage/metric/tiered_test.go @@ -370,7 +370,6 @@ func testMakeView(t test.Tester) { for i, scenario := range scenarios { tiered, closer := newTestTieredStorage(t) - defer closer.Close() for j, datum := range scenario.data { err := tiered.AppendSample(datum) @@ -418,7 +417,7 @@ func testMakeView(t test.Tester) { } } - tiered.Drain() + closer.Close() } }