From c6066d6ee4da0e1ac193ad986ca2b8c470f070f7 Mon Sep 17 00:00:00 2001 From: Aleksey Savchuk Date: Tue, 12 Nov 2024 17:15:23 +0300 Subject: [PATCH] [#1491] engine/test: Use more suitable testing utils here and there Use `setShardsNum` instead of `setInitializedShards` wherever possible. Signed-off-by: Aleksey Savchuk --- pkg/local_object_storage/engine/delete_test.go | 6 +----- pkg/local_object_storage/engine/engine_test.go | 7 +------ 2 files changed, 2 insertions(+), 11 deletions(-) diff --git a/pkg/local_object_storage/engine/delete_test.go b/pkg/local_object_storage/engine/delete_test.go index 0904c9820..e095e4bbd 100644 --- a/pkg/local_object_storage/engine/delete_test.go +++ b/pkg/local_object_storage/engine/delete_test.go @@ -49,11 +49,7 @@ func TestDeleteBigObject(t *testing.T) { link.SetSplitID(splitID) link.SetChildren(childIDs...) - s1 := testNewShard(t) - s2 := testNewShard(t) - s3 := testNewShard(t) - - e := testNewEngine(t).setInitializedShards(t, s1, s2, s3).engine + e := testNewEngine(t).setShardsNum(t, 3).engine e.log = test.NewLogger(t) defer e.Close(context.Background()) diff --git a/pkg/local_object_storage/engine/engine_test.go b/pkg/local_object_storage/engine/engine_test.go index 88c523b76..44bda2cbc 100644 --- a/pkg/local_object_storage/engine/engine_test.go +++ b/pkg/local_object_storage/engine/engine_test.go @@ -43,12 +43,7 @@ func BenchmarkExists(b *testing.B) { } func benchmarkExists(b *testing.B, shardNum int) { - shards := make([]*shard.Shard, shardNum) - for i := range shardNum { - shards[i] = testNewShard(b) - } - - e := testNewEngine(b).setInitializedShards(b, shards...).engine + e := testNewEngine(b).setShardsNum(b, shardNum).engine defer func() { require.NoError(b, e.Close(context.Background())) }() addr := oidtest.Address()