mirror of
https://gitee.com/milvus-io/milvus.git
synced 2025-12-08 01:58:34 +08:00
issue: #33285 - add two grpc resolver (by session and by streaming coord assignment service) - add one grpc balancer (by serverID and roundrobin) - add lazy conn to avoid block by first service discovery - add some utility function for streaming service Signed-off-by: chyezh <chyezh@outlook.com>
35 lines
686 B
Go
35 lines
686 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/mock_metastore"
|
|
)
|
|
|
|
func TestInit(t *testing.T) {
|
|
assert.Panics(t, func() {
|
|
Init()
|
|
})
|
|
assert.Panics(t, func() {
|
|
Init(OptETCD(&clientv3.Client{}))
|
|
})
|
|
assert.Panics(t, func() {
|
|
Init(OptStreamingCatalog(
|
|
mock_metastore.NewMockStreamingCoordCataLog(t),
|
|
))
|
|
})
|
|
Init(OptETCD(&clientv3.Client{}), OptStreamingCatalog(
|
|
mock_metastore.NewMockStreamingCoordCataLog(t),
|
|
))
|
|
|
|
assert.NotNil(t, Resource().StreamingCatalog())
|
|
assert.NotNil(t, Resource().ETCD())
|
|
}
|
|
|
|
func TestInitForTest(t *testing.T) {
|
|
InitForTest()
|
|
}
|