diff --git a/pkg/shipper/shipper.go b/pkg/shipper/shipper.go index 46bd9c1bcc..e3f1bec554 100644 --- a/pkg/shipper/shipper.go +++ b/pkg/shipper/shipper.go @@ -419,7 +419,6 @@ func (s *Shipper) iterBlockMetas(f func(m *metadata.Meta) error) error { return metas[i].BlockMeta.MinTime < metas[j].BlockMeta.MinTime }) for _, m := range metas { - if err := f(m); err != nil { return err } diff --git a/pkg/shipper/shipper_test.go b/pkg/shipper/shipper_test.go index fd9b75706f..f258dd8b49 100644 --- a/pkg/shipper/shipper_test.go +++ b/pkg/shipper/shipper_test.go @@ -9,7 +9,6 @@ import ( "math/rand" "os" "path" - "sort" "testing" "github.com/go-kit/kit/log" @@ -84,7 +83,6 @@ func TestShipperTimestamps(t *testing.T) { } func TestIterBlockMetas(t *testing.T) { - var metas []*metadata.Meta dir, err := ioutil.TempDir("", "shipper-test") testutil.Ok(t, err) defer func() { @@ -124,16 +122,15 @@ func TestIterBlockMetas(t *testing.T) { }, })) + var ids []ulid.ULID shipper := New(nil, nil, dir, nil, nil, metadata.TestSource) if err := shipper.iterBlockMetas(func(m *metadata.Meta) error { - metas = append(metas, m) + ids = append(ids, m.ULID) return nil }); err != nil { testutil.Ok(t, err) } - testutil.Equals(t, sort.SliceIsSorted(metas, func(i, j int) bool { - return metas[i].BlockMeta.MinTime < metas[j].BlockMeta.MinTime - }), true) + testutil.Equals(t, []ulid.ULID{id1, id3, id2}, ids) } func BenchmarkIterBlockMetas(b *testing.B) {