[#956] policer/test: Reuse testPool helper

Signed-off-by: Evgenii Stratonikov <e.stratonikov@yadro.com>
pull/958/head
Evgenii Stratonikov 2024-02-02 20:57:49 +03:00 committed by Evgenii Stratonikov
parent cbfeb72466
commit edbe06e07e
1 changed files with 2 additions and 9 deletions

View File

@ -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
},