forked from TrueCloudLab/frostfs-node
[#956] policer/test: Reuse testPool helper
Signed-off-by: Evgenii Stratonikov <e.stratonikov@yadro.com>bugfix/namespace_require
parent
cbfeb72466
commit
edbe06e07e
|
@ -48,16 +48,12 @@ func TestBuryObjectWithoutContainer(t *testing.T) {
|
|||
return nil
|
||||
}
|
||||
|
||||
// Task pool
|
||||
pool, err := ants.NewPool(4)
|
||||
require.NoError(t, err)
|
||||
|
||||
// Policer instance
|
||||
p := New(
|
||||
WithKeySpaceIterator(&sliceKeySpaceIterator{objs: objs}),
|
||||
WithContainerSource(containerSrc),
|
||||
WithBuryFunc(buryFn),
|
||||
WithPool(pool),
|
||||
WithPool(testPool(t)),
|
||||
)
|
||||
|
||||
ctx, cancel := context.WithCancel(context.Background())
|
||||
|
@ -298,9 +294,6 @@ func TestIteratorContract(t *testing.T) {
|
|||
return nil
|
||||
}
|
||||
|
||||
pool, err := ants.NewPool(4)
|
||||
require.NoError(t, err)
|
||||
|
||||
it := &predefinedIterator{
|
||||
scenario: []nextResult{
|
||||
{objs, nil},
|
||||
|
@ -326,7 +319,7 @@ func TestIteratorContract(t *testing.T) {
|
|||
WithKeySpaceIterator(it),
|
||||
WithContainerSource(containerSrc),
|
||||
WithBuryFunc(buryFn),
|
||||
WithPool(pool),
|
||||
WithPool(testPool(t)),
|
||||
func(c *cfg) {
|
||||
c.sleepDuration = time.Millisecond
|
||||
},
|
||||
|
|
Loading…
Reference in New Issue