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