WIP: Morph: Add unit tests #2

Closed
dstepanov-yadro wants to merge 233 commits from TrueCloudLab/frostfs-node:master into object-3608-morph-unit-tests
Showing only changes of commit d35e4c389f - Show all commits

View file

@ -12,6 +12,7 @@ import (
cidtest "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/container/id/test"
objectSDK "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/object"
"github.com/stretchr/testify/require"
"golang.org/x/sync/errgroup"
)
func TestWriteCacheObjectLoss(t *testing.T) {
@ -39,13 +40,17 @@ func TestWriteCacheObjectLoss(t *testing.T) {
sh := newCustomShard(t, dir, true, wcOpts, nil)
var putPrm shard.PutPrm
var errG errgroup.Group
for i := range objects {
putPrm.SetObject(objects[i])
_, err := sh.Put(context.Background(), putPrm)
require.NoError(t, err)
obj := objects[i]
errG.Go(func() error {
var putPrm shard.PutPrm
putPrm.SetObject(obj)
_, err := sh.Put(context.Background(), putPrm)
return err
})
}
require.NoError(t, errG.Wait())
require.NoError(t, sh.Close())
sh = newCustomShard(t, dir, true, wcOpts, nil)