Skip to content

Commit

Permalink
meta: fix Delete test (#2949)
Browse files Browse the repository at this point in the history
  • Loading branch information
roman-khimov authored Sep 24, 2024
2 parents 8340d68 + 8c2e18d commit ca16d59
Showing 1 changed file with 6 additions and 4 deletions.
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

0 comments on commit ca16d59

Please sign in to comment.