94d341bcf3
Peer for generating bloom filters will be able to use ranged loop. As an addition some cleanup were made: * remove unused parts of GC BF peer (identity, version control) * added missing Close method for ranged loop service * some additional tests added https://github.com/storj/storj/issues/5545 Change-Id: I9a3d85f5fffd2ebc7f2bf7ed024220117ab2be29
46 lines
1.2 KiB
Go
46 lines
1.2 KiB
Go
// Copyright (C) 2023 Storj Labs, Inc.
|
|
// See LICENSE for copying information.
|
|
|
|
package satellite_test
|
|
|
|
import (
|
|
"testing"
|
|
|
|
"github.com/stretchr/testify/require"
|
|
"go.uber.org/zap"
|
|
|
|
"storj.io/common/testcontext"
|
|
"storj.io/storj/private/testplanet"
|
|
"storj.io/storj/satellite"
|
|
)
|
|
|
|
func TestGCBFUseRangedLoop(t *testing.T) {
|
|
testplanet.Run(t, testplanet.Config{
|
|
SatelliteCount: 1,
|
|
Reconfigure: testplanet.Reconfigure{
|
|
Satellite: func(log *zap.Logger, index int, config *satellite.Config) {
|
|
config.GarbageCollectionBF.RunOnce = true
|
|
config.GarbageCollectionBF.UseRangedLoop = true
|
|
},
|
|
},
|
|
}, func(t *testing.T, ctx *testcontext.Context, planet *testplanet.Planet) {
|
|
err := planet.Satellites[0].GCBF.Run(ctx)
|
|
require.NoError(t, err)
|
|
})
|
|
}
|
|
|
|
func TestGCBFUseSegmentsLoop(t *testing.T) {
|
|
testplanet.Run(t, testplanet.Config{
|
|
SatelliteCount: 1,
|
|
Reconfigure: testplanet.Reconfigure{
|
|
Satellite: func(log *zap.Logger, index int, config *satellite.Config) {
|
|
config.GarbageCollectionBF.RunOnce = true
|
|
config.GarbageCollectionBF.UseRangedLoop = false
|
|
},
|
|
},
|
|
}, func(t *testing.T, ctx *testcontext.Context, planet *testplanet.Planet) {
|
|
err := planet.Satellites[0].GCBF.Run(ctx)
|
|
require.NoError(t, err)
|
|
})
|
|
}
|