[#1491] engine/test: Use more suitable testing utils here and there

Use `setShardsNum` instead of `setInitializedShards` wherever possible.

Signed-off-by: Aleksey Savchuk <a.savchuk@yadro.com>
This commit is contained in:
Aleksey Savchuk 2024-11-12 17:15:23 +03:00
parent 612b34d570
commit c6066d6ee4
Signed by: a-savchuk
GPG key ID: 70C0A7FF6F9C4639
2 changed files with 2 additions and 11 deletions

View file

@ -49,11 +49,7 @@ func TestDeleteBigObject(t *testing.T) {
link.SetSplitID(splitID) link.SetSplitID(splitID)
link.SetChildren(childIDs...) link.SetChildren(childIDs...)
s1 := testNewShard(t) e := testNewEngine(t).setShardsNum(t, 3).engine
s2 := testNewShard(t)
s3 := testNewShard(t)
e := testNewEngine(t).setInitializedShards(t, s1, s2, s3).engine
e.log = test.NewLogger(t) e.log = test.NewLogger(t)
defer e.Close(context.Background()) defer e.Close(context.Background())

View file

@ -43,12 +43,7 @@ func BenchmarkExists(b *testing.B) {
} }
func benchmarkExists(b *testing.B, shardNum int) { func benchmarkExists(b *testing.B, shardNum int) {
shards := make([]*shard.Shard, shardNum) e := testNewEngine(b).setShardsNum(b, shardNum).engine
for i := range shardNum {
shards[i] = testNewShard(b)
}
e := testNewEngine(b).setInitializedShards(b, shards...).engine
defer func() { require.NoError(b, e.Close(context.Background())) }() defer func() { require.NoError(b, e.Close(context.Background())) }()
addr := oidtest.Address() addr := oidtest.Address()