diff --git a/pkg/local_object_storage/blobstor/internal/blobstortest/iterate.go b/pkg/local_object_storage/blobstor/internal/blobstortest/iterate.go index e2a310efcc..f98cca6386 100644 --- a/pkg/local_object_storage/blobstor/internal/blobstortest/iterate.go +++ b/pkg/local_object_storage/blobstor/internal/blobstortest/iterate.go @@ -9,7 +9,6 @@ import ( "github.com/stretchr/testify/require" ) -// nolint: funlen func TestIterate(t *testing.T, cons Constructor, min, max uint64) { s := cons(t) require.NoError(t, s.Open(false)) @@ -28,6 +27,14 @@ func TestIterate(t *testing.T, cons Constructor, min, max uint64) { objects = append(objects[:delID], objects[delID+1:]...) + runTestNormalHandler(t, s, objects) + + runTestLazyHandler(t, s, objects) + + runTestIgnoreLogicalErrors(t, s, objects) +} + +func runTestNormalHandler(t *testing.T, s common.Storage, objects []objectDesc) { t.Run("normal handler", func(t *testing.T) { seen := make(map[string]objectDesc) @@ -52,7 +59,9 @@ func TestIterate(t *testing.T, cons Constructor, min, max uint64) { require.Equal(t, objects[i].storageID, d.storageID) } }) +} +func runTestLazyHandler(t *testing.T, s common.Storage, objects []objectDesc) { t.Run("lazy handler", func(t *testing.T) { seen := make(map[string]func() ([]byte, error)) @@ -74,7 +83,9 @@ func TestIterate(t *testing.T, cons Constructor, min, max uint64) { require.Equal(t, objects[i].raw, data) } }) +} +func runTestIgnoreLogicalErrors(t *testing.T, s common.Storage, objects []objectDesc) { t.Run("ignore errors doesn't work for logical errors", func(t *testing.T) { seen := make(map[string]objectDesc)