[#649] shard/test: Increase GC remover interval

This was set in #348 to speed up tests.
It seems 100ms doesn't increase overall test time,
but it reduces the amount of logs by 100x factor.

Signed-off-by: Evgenii Stratonikov <e.stratonikov@yadro.com>
This commit is contained in:
Evgenii Stratonikov 2023-08-25 12:04:34 +03:00 committed by Evgenii Stratonikov
parent c4db8e7690
commit 9072772a09
2 changed files with 10 additions and 5 deletions

View file

@ -3,6 +3,7 @@ package shard_test
import ( import (
"context" "context"
"testing" "testing"
"time"
"git.frostfs.info/TrueCloudLab/frostfs-node/pkg/core/object" "git.frostfs.info/TrueCloudLab/frostfs-node/pkg/core/object"
"git.frostfs.info/TrueCloudLab/frostfs-node/pkg/local_object_storage/internal/testutil" "git.frostfs.info/TrueCloudLab/frostfs-node/pkg/local_object_storage/internal/testutil"
@ -56,8 +57,10 @@ func testShardDelete(t *testing.T, hasWriteCache bool) {
_, err = sh.Delete(context.TODO(), delPrm) _, err = sh.Delete(context.TODO(), delPrm)
require.NoError(t, err) require.NoError(t, err)
require.Eventually(t, func() bool {
_, err = sh.Get(context.Background(), getPrm) _, err = sh.Get(context.Background(), getPrm)
require.True(t, client.IsErrObjectNotFound(err)) return client.IsErrObjectNotFound(err)
}, time.Second, 50*time.Millisecond)
}) })
t.Run("small object", func(t *testing.T) { t.Run("small object", func(t *testing.T) {
@ -80,7 +83,9 @@ func testShardDelete(t *testing.T, hasWriteCache bool) {
_, err = sh.Delete(context.Background(), delPrm) _, err = sh.Delete(context.Background(), delPrm)
require.NoError(t, err) require.NoError(t, err)
require.Eventually(t, func() bool {
_, err = sh.Get(context.Background(), getPrm) _, err = sh.Get(context.Background(), getPrm)
require.True(t, client.IsErrObjectNotFound(err)) return client.IsErrObjectNotFound(err)
}, time.Second, 50*time.Millisecond)
}) })
} }

View file

@ -101,7 +101,7 @@ func newCustomShard(t testing.TB, rootPath string, enableWriteCache bool, wcOpts
require.NoError(t, err) require.NoError(t, err)
return pool return pool
}), }),
shard.WithGCRemoverSleepInterval(1 * time.Millisecond), shard.WithGCRemoverSleepInterval(100 * time.Millisecond),
} }
sh = shard.New(opts...) sh = shard.New(opts...)