forked from TrueCloudLab/frostfs-node
[#1381] engine: Fix tests
Drop not required `Eventually` calls. Signed-off-by: Dmitrii Stepanov <d.stepanov@yadro.com>
This commit is contained in:
parent
f71418b73c
commit
0b87be804a
4 changed files with 11 additions and 47 deletions
|
@ -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))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue