[#668] shard/test: Simplify shard construction

newCustomShard() has many parameters but only the first is obligatory.
`enableWriteCache` is left as-is, because it directly affects the
functionality.

Signed-off-by: Evgenii Stratonikov <e.stratonikov@yadro.com>
This commit is contained in:
Evgenii Stratonikov 2023-09-06 17:32:14 +03:00 committed by Evgenii Stratonikov
parent 429f941cda
commit 268adb79cb
4 changed files with 55 additions and 44 deletions

View file

@ -43,7 +43,7 @@ func TestWriteCacheObjectLoss(t *testing.T) {
},
}
sh := newCustomShard(t, dir, true, wcOpts, nil, nil)
sh := newCustomShard(t, true, shardOptions{rootPath: dir, wcOpts: wcOpts})
var errG errgroup.Group
for i := range objects {
@ -58,7 +58,7 @@ func TestWriteCacheObjectLoss(t *testing.T) {
require.NoError(t, errG.Wait())
require.NoError(t, sh.Close())
sh = newCustomShard(t, dir, true, wcOpts, nil, nil)
sh = newCustomShard(t, true, shardOptions{rootPath: dir, wcOpts: wcOpts})
defer releaseShard(sh, t)
var getPrm GetPrm