forked from TrueCloudLab/frostfs-node
[#168] node: Refactor node config
Resolve containedctx linter for cfg Signed-off-by: Dmitrii Stepanov <d.stepanov@yadro.com>
This commit is contained in:
parent
8426d25f4b
commit
a7c79c773a
20 changed files with 93 additions and 83 deletions
|
@ -1,6 +1,7 @@
|
|||
package shard
|
||||
|
||||
import (
|
||||
"context"
|
||||
"io/fs"
|
||||
"math"
|
||||
"os"
|
||||
|
@ -83,7 +84,7 @@ func TestShardOpen(t *testing.T) {
|
|||
|
||||
sh := newShard()
|
||||
require.NoError(t, sh.Open())
|
||||
require.NoError(t, sh.Init())
|
||||
require.NoError(t, sh.Init(context.Background()))
|
||||
require.Equal(t, mode.ReadWrite, sh.GetMode())
|
||||
require.NoError(t, sh.Close())
|
||||
|
||||
|
@ -92,7 +93,7 @@ func TestShardOpen(t *testing.T) {
|
|||
|
||||
sh = newShard()
|
||||
require.NoError(t, sh.Open())
|
||||
require.NoError(t, sh.Init())
|
||||
require.NoError(t, sh.Init(context.Background()))
|
||||
require.Equal(t, mode.ReadOnly, sh.GetMode())
|
||||
require.Error(t, sh.SetMode(mode.ReadWrite))
|
||||
require.Equal(t, mode.ReadOnly, sh.GetMode())
|
||||
|
@ -103,7 +104,7 @@ func TestShardOpen(t *testing.T) {
|
|||
|
||||
sh = newShard()
|
||||
require.NoError(t, sh.Open())
|
||||
require.NoError(t, sh.Init())
|
||||
require.NoError(t, sh.Init(context.Background()))
|
||||
require.Equal(t, mode.DegradedReadOnly, sh.GetMode())
|
||||
require.NoError(t, sh.Close())
|
||||
}
|
||||
|
@ -128,7 +129,7 @@ func TestRefillMetabaseCorrupted(t *testing.T) {
|
|||
WithPiloramaOptions(pilorama.WithPath(filepath.Join(dir, "pilorama"))),
|
||||
WithMetaBaseOptions(meta.WithPath(filepath.Join(dir, "meta")), meta.WithEpochState(epochState{})))
|
||||
require.NoError(t, sh.Open())
|
||||
require.NoError(t, sh.Init())
|
||||
require.NoError(t, sh.Init(context.Background()))
|
||||
|
||||
obj := objecttest.Object()
|
||||
obj.SetType(objectSDK.TypeRegular)
|
||||
|
@ -150,7 +151,7 @@ func TestRefillMetabaseCorrupted(t *testing.T) {
|
|||
WithMetaBaseOptions(meta.WithPath(filepath.Join(dir, "meta_new")), meta.WithEpochState(epochState{})),
|
||||
WithRefillMetabase(true))
|
||||
require.NoError(t, sh.Open())
|
||||
require.NoError(t, sh.Init())
|
||||
require.NoError(t, sh.Init(context.Background()))
|
||||
|
||||
var getPrm GetPrm
|
||||
getPrm.SetAddress(addr)
|
||||
|
@ -188,7 +189,7 @@ func TestRefillMetabase(t *testing.T) {
|
|||
require.NoError(t, sh.Open())
|
||||
|
||||
// initialize Blobstor
|
||||
require.NoError(t, sh.Init())
|
||||
require.NoError(t, sh.Init(context.Background()))
|
||||
|
||||
const objNum = 5
|
||||
|
||||
|
@ -355,7 +356,7 @@ func TestRefillMetabase(t *testing.T) {
|
|||
require.NoError(t, sh.Open())
|
||||
|
||||
// initialize Blobstor
|
||||
require.NoError(t, sh.Init())
|
||||
require.NoError(t, sh.Init(context.Background()))
|
||||
|
||||
defer sh.Close()
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue