mirror of
https://gitee.com/milvus-io/milvus.git
synced 2025-12-30 07:25:37 +08:00
issue: #33285 - add idAlloc interface - fix binary unsafe bug for message - fix service discovery lost when repeated address with different server id --------- Signed-off-by: chyezh <chyezh@outlook.com>
32 lines
669 B
Go
32 lines
669 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"
|
|
)
|
|
|
|
func TestInit(t *testing.T) {
|
|
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)))
|
|
|
|
assert.NotNil(t, Resource().TSOAllocator())
|
|
assert.NotNil(t, Resource().ETCD())
|
|
assert.NotNil(t, Resource().RootCoordClient())
|
|
}
|
|
|
|
func TestInitForTest(t *testing.T) {
|
|
InitForTest()
|
|
}
|