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
|
@ -122,6 +122,9 @@ func testEngineFailInitAndReload(t *testing.T, errOnAdd bool, opts []shard.Optio
|
|||
var configID string
|
||||
|
||||
e := New()
|
||||
defer func() {
|
||||
require.NoError(t, e.Close(context.Background()))
|
||||
}()
|
||||
_, err := e.AddShard(context.Background(), opts...)
|
||||
if errOnAdd {
|
||||
require.Error(t, err)
|
||||
|
@ -258,6 +261,8 @@ func TestReload(t *testing.T) {
|
|||
|
||||
require.Equal(t, shardNum+1, len(e.shards))
|
||||
require.Equal(t, shardNum+1, len(e.shardPools))
|
||||
|
||||
require.NoError(t, e.Close(context.Background()))
|
||||
})
|
||||
|
||||
t.Run("remove shards", func(t *testing.T) {
|
||||
|
@ -276,6 +281,8 @@ func TestReload(t *testing.T) {
|
|||
// removed one
|
||||
require.Equal(t, shardNum-1, len(e.shards))
|
||||
require.Equal(t, shardNum-1, len(e.shardPools))
|
||||
|
||||
require.NoError(t, e.Close(context.Background()))
|
||||
})
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue