forked from TrueCloudLab/frostfs-node
[#895] test: Use t.Cleanup only for external resources
Signed-off-by: Dmitrii Stepanov <d.stepanov@yadro.com>
This commit is contained in:
parent
836818fb75
commit
47dcfa20f3
50 changed files with 164 additions and 95 deletions
|
@ -22,6 +22,7 @@ func TestCounters(t *testing.T) {
|
|||
t.Run("defaults", func(t *testing.T) {
|
||||
t.Parallel()
|
||||
db := newDB(t)
|
||||
defer func() { require.NoError(t, db.Close()) }()
|
||||
c, err := db.ObjectCounters()
|
||||
require.NoError(t, err)
|
||||
require.Zero(t, c.Phy)
|
||||
|
@ -36,6 +37,7 @@ func TestCounters(t *testing.T) {
|
|||
t.Run("put", func(t *testing.T) {
|
||||
t.Parallel()
|
||||
db := newDB(t)
|
||||
defer func() { require.NoError(t, db.Close()) }()
|
||||
oo := make([]*objectSDK.Object, 0, objCount)
|
||||
for i := 0; i < objCount; i++ {
|
||||
oo = append(oo, testutil.GenerateObject())
|
||||
|
@ -73,6 +75,7 @@ func TestCounters(t *testing.T) {
|
|||
t.Run("delete", func(t *testing.T) {
|
||||
t.Parallel()
|
||||
db := newDB(t)
|
||||
defer func() { require.NoError(t, db.Close()) }()
|
||||
oo := putObjs(t, db, objCount, false)
|
||||
|
||||
exp := make(map[cid.ID]meta.ObjectCounters)
|
||||
|
@ -117,6 +120,7 @@ func TestCounters(t *testing.T) {
|
|||
t.Run("inhume", func(t *testing.T) {
|
||||
t.Parallel()
|
||||
db := newDB(t)
|
||||
defer func() { require.NoError(t, db.Close()) }()
|
||||
oo := putObjs(t, db, objCount, false)
|
||||
|
||||
exp := make(map[cid.ID]meta.ObjectCounters)
|
||||
|
@ -176,6 +180,7 @@ func TestCounters(t *testing.T) {
|
|||
t.Run("put_split", func(t *testing.T) {
|
||||
t.Parallel()
|
||||
db := newDB(t)
|
||||
defer func() { require.NoError(t, db.Close()) }()
|
||||
parObj := testutil.GenerateObject()
|
||||
|
||||
exp := make(map[cid.ID]meta.ObjectCounters)
|
||||
|
@ -213,6 +218,7 @@ func TestCounters(t *testing.T) {
|
|||
t.Run("delete_split", func(t *testing.T) {
|
||||
t.Parallel()
|
||||
db := newDB(t)
|
||||
defer func() { require.NoError(t, db.Close()) }()
|
||||
oo := putObjs(t, db, objCount, true)
|
||||
|
||||
exp := make(map[cid.ID]meta.ObjectCounters)
|
||||
|
@ -254,6 +260,7 @@ func TestCounters(t *testing.T) {
|
|||
t.Run("inhume_split", func(t *testing.T) {
|
||||
t.Parallel()
|
||||
db := newDB(t)
|
||||
defer func() { require.NoError(t, db.Close()) }()
|
||||
oo := putObjs(t, db, objCount, true)
|
||||
|
||||
exp := make(map[cid.ID]meta.ObjectCounters)
|
||||
|
@ -321,6 +328,7 @@ func TestCounters_Expired(t *testing.T) {
|
|||
|
||||
es := &epochState{epoch}
|
||||
db := newDB(t, meta.WithEpochState(es))
|
||||
defer func() { require.NoError(t, db.Close()) }()
|
||||
|
||||
oo := make([]oid.Address, objCount)
|
||||
for i := range oo {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue