Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

meta: fix Delete test #2949

Merged
merged 1 commit into from
Sep 24, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions pkg/local_object_storage/metabase/delete_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ func TestDB_Delete(t *testing.T) {
err = metaDelete(db, object.AddressOf(parent))
require.NoError(t, err)

// inhume parent and child so they will be on graveyard
// inhume child so it will be on graveyard
ts := generateObjectWithCID(t, cnr)

err = metaInhume(db, object.AddressOf(child), object.AddressOf(ts))
Expand All @@ -58,14 +58,16 @@ func TestDB_Delete(t *testing.T) {
require.NoError(t, err)
require.Len(t, l, 0)

// check if they marked as already removed
// check if the child is still inhumed (deletion should not affect
// TS status that should be kept for some epochs and be handled
// separately) and parent is not found

ok, err := metaExists(db, object.AddressOf(child))
require.Error(t, apistatus.ObjectAlreadyRemoved{})
require.ErrorIs(t, err, apistatus.ErrObjectAlreadyRemoved)
require.False(t, ok)

ok, err = metaExists(db, object.AddressOf(parent))
require.Error(t, apistatus.ObjectAlreadyRemoved{})
require.NoError(t, err)
require.False(t, ok)
}

Expand Down
Loading