[#1381] engine: Fix tests

Drop not required `Eventually` calls.

Signed-off-by: Dmitrii Stepanov <d.stepanov@yadro.com>
This commit is contained in:
Dmitrii Stepanov 2024-09-17 11:24:48 +03:00
parent f71418b73c
commit 0b87be804a
4 changed files with 11 additions and 47 deletions

View file

@ -3,7 +3,6 @@ package shard
import (
"context"
"testing"
"time"
"git.frostfs.info/TrueCloudLab/frostfs-node/pkg/core/object"
"git.frostfs.info/TrueCloudLab/frostfs-node/pkg/local_object_storage/internal/testutil"
@ -58,19 +57,14 @@ func testShard(t *testing.T, hasWriteCache bool, payloadSize int) {
_, err := sh.Put(context.Background(), putPrm)
require.NoError(t, err)
_, err = testGet(t, sh, getPrm, hasWriteCache)
_, err = sh.Get(context.Background(), getPrm)
require.NoError(t, err)
if hasWriteCache {
sh.FlushWriteCache(context.Background(), FlushWriteCachePrm{ignoreErrors: false})
require.Eventually(t, func() bool {
_, err = sh.Delete(context.Background(), delPrm)
return err == nil
}, 30*time.Second, 10*time.Millisecond)
} else {
_, err = sh.Delete(context.Background(), delPrm)
require.NoError(t, err)
require.NoError(t, sh.FlushWriteCache(context.Background(), FlushWriteCachePrm{ignoreErrors: false}))
}
_, err = sh.Delete(context.Background(), delPrm)
require.NoError(t, err)
_, err = sh.Get(context.Background(), getPrm)
require.True(t, client.IsErrObjectNotFound(err))