mirror of
https://gitee.com/milvus-io/milvus.git
synced 2025-12-07 09:38:39 +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>
41 lines
939 B
Go
41 lines
939 B
Go
package resource
|
|
|
|
import (
|
|
"testing"
|
|
|
|
"github.com/stretchr/testify/assert"
|
|
clientv3 "go.etcd.io/etcd/client/v3"
|
|
|
|
"github.com/milvus-io/milvus/internal/mocks"
|
|
"github.com/milvus-io/milvus/internal/mocks/mock_metastore"
|
|
"github.com/milvus-io/milvus/pkg/util/paramtable"
|
|
)
|
|
|
|
func TestInit(t *testing.T) {
|
|
paramtable.Init()
|
|
|
|
assert.Panics(t, func() {
|
|
Init()
|
|
})
|
|
assert.Panics(t, func() {
|
|
Init(OptETCD(&clientv3.Client{}))
|
|
})
|
|
assert.Panics(t, func() {
|
|
Init(OptRootCoordClient(mocks.NewMockRootCoordClient(t)))
|
|
})
|
|
Init(
|
|
OptETCD(&clientv3.Client{}),
|
|
OptRootCoordClient(mocks.NewMockRootCoordClient(t)),
|
|
OptDataCoordClient(mocks.NewMockDataCoordClient(t)),
|
|
OptStreamingNodeCatalog(mock_metastore.NewMockStreamingNodeCataLog(t)),
|
|
)
|
|
|
|
assert.NotNil(t, Resource().TSOAllocator())
|
|
assert.NotNil(t, Resource().ETCD())
|
|
assert.NotNil(t, Resource().RootCoordClient())
|
|
}
|
|
|
|
func TestInitForTest(t *testing.T) {
|
|
InitForTest(t)
|
|
}
|