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
|
@ -30,7 +30,6 @@ func (s epochState) CurrentEpoch() uint64 {
|
|||
|
||||
type shardOptions struct {
|
||||
rootPath string
|
||||
dontRelease bool
|
||||
wcOpts []writecache.Option
|
||||
bsOpts []blobstor.Option
|
||||
metaOptions []meta.Option
|
||||
|
@ -109,13 +108,5 @@ func newCustomShard(t testing.TB, enableWriteCache bool, o shardOptions) *Shard
|
|||
require.NoError(t, sh.Open(context.Background()))
|
||||
require.NoError(t, sh.Init(context.Background()))
|
||||
|
||||
if !o.dontRelease {
|
||||
t.Cleanup(func() { releaseShard(sh, t) })
|
||||
}
|
||||
|
||||
return sh
|
||||
}
|
||||
|
||||
func releaseShard(s *Shard, t testing.TB) {
|
||||
require.NoError(t, s.Close())
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue