mirror of
https://gitee.com/milvus-io/milvus.git
synced 2025-12-08 01:58:34 +08:00
issue: #33285 - remove redundant goroutine by using insepctor. - remove the coutinous non-message timetick persistence - periodically push the time tick forward without persistent timetick message. - add 'message type filter' deliver filter. Signed-off-by: chyezh <chyezh@outlook.com>
33 lines
1.2 KiB
Go
33 lines
1.2 KiB
Go
//go:build test
|
|
// +build test
|
|
|
|
package resource
|
|
|
|
import (
|
|
"testing"
|
|
|
|
"github.com/milvus-io/milvus/internal/streamingnode/server/resource/idalloc"
|
|
sinspector "github.com/milvus-io/milvus/internal/streamingnode/server/wal/interceptors/segment/inspector"
|
|
"github.com/milvus-io/milvus/internal/streamingnode/server/wal/interceptors/segment/stats"
|
|
tinspector "github.com/milvus-io/milvus/internal/streamingnode/server/wal/interceptors/timetick/inspector"
|
|
)
|
|
|
|
// InitForTest initializes the singleton of resources for test.
|
|
func InitForTest(t *testing.T, opts ...optResourceInit) {
|
|
r = &resourceImpl{}
|
|
for _, opt := range opts {
|
|
opt(r)
|
|
}
|
|
if r.rootCoordClient != nil {
|
|
r.timestampAllocator = idalloc.NewTSOAllocator(r.rootCoordClient)
|
|
r.idAllocator = idalloc.NewIDAllocator(r.rootCoordClient)
|
|
} else {
|
|
r.rootCoordClient = idalloc.NewMockRootCoordClient(t)
|
|
r.timestampAllocator = idalloc.NewTSOAllocator(r.rootCoordClient)
|
|
r.idAllocator = idalloc.NewIDAllocator(r.rootCoordClient)
|
|
}
|
|
r.segmentAssignStatsManager = stats.NewStatsManager()
|
|
r.segmentSealedInspector = sinspector.NewSealedInspector(r.segmentAssignStatsManager.SealNotifier())
|
|
r.timeTickInspector = tinspector.NewTimeTickSyncInspector()
|
|
}
|