engine/test: Rework StorageEngine
's test utils #1491
Labels
No labels
P0
P1
P2
P3
badger
frostfs-adm
frostfs-cli
frostfs-ir
frostfs-lens
frostfs-node
good first issue
triage
Infrastructure
blocked
bug
config
discussion
documentation
duplicate
enhancement
go
help wanted
internal
invalid
kludge
observability
perfomance
question
refactoring
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: TrueCloudLab/frostfs-node#1491
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Block solutions for #1450
Problems
Minor problem
(*testEngineWrapper).setInitializedShards
mostly duplicates(*StorageEngine).addShard
and hardcodes the shard worker pool size, preventing it from being configured in tests/benchmarksfunc (te *testEngineWrapper) setInitializedShards(t testing.TB, shards ...*shard.Shard) *testEngineWrapper {
for _, s := range shards {
pool, err := ants.NewPool(10, ants.WithNonblocking(true))
Major problem
Some utils indirectly use
testNewShard
function, which itself initializes a new shard. This violates the default engine workflow, which should be: first useNew()
, followed byOpen()
, and thenInit()
. As a result, adding new logic to(*StorageEngine).Init
causes several tests to fail with a panic when attempting to access uninitialized resourcesSolution
Since, the only purpose of
(*testEngineWrapper).setInitializedShards
is to create shards before creating an engine, allowing future access them in the future, it's unnecessary to initialize the shard before initializing the engine. I suggest the following changes:testNewShard
StorageEngine
's test utils #1494