mirror of
https://gitee.com/milvus-io/milvus.git
synced 2025-12-07 01:28:27 +08:00
This PR implements a new CDC service for Milvus 2.6, providing log-based cross-cluster replication. issue: https://github.com/milvus-io/milvus/issues/44123 --------- Signed-off-by: bigsheeper <yihao.dai@zilliz.com> Signed-off-by: chyezh <chyezh@outlook.com> Co-authored-by: chyezh <chyezh@outlook.com>
47 lines
1.1 KiB
Go
47 lines
1.1 KiB
Go
package server
|
|
|
|
import (
|
|
"context"
|
|
"strings"
|
|
"testing"
|
|
|
|
"github.com/stretchr/testify/assert"
|
|
|
|
etcdkv "github.com/milvus-io/milvus/internal/kv/etcd"
|
|
"github.com/milvus-io/milvus/internal/streamingcoord/server/balancer/channel"
|
|
"github.com/milvus-io/milvus/internal/types"
|
|
"github.com/milvus-io/milvus/internal/util/sessionutil"
|
|
"github.com/milvus-io/milvus/pkg/v2/util/etcd"
|
|
"github.com/milvus-io/milvus/pkg/v2/util/paramtable"
|
|
"github.com/milvus-io/milvus/pkg/v2/util/syncutil"
|
|
)
|
|
|
|
func TestServer(t *testing.T) {
|
|
paramtable.Init()
|
|
|
|
params := paramtable.Get()
|
|
|
|
channel.RecoverPChannelStatsManager([]string{})
|
|
|
|
endpoints := params.EtcdCfg.Endpoints.GetValue()
|
|
etcdEndpoints := strings.Split(endpoints, ",")
|
|
c, err := etcd.GetRemoteEtcdClient(etcdEndpoints)
|
|
assert.NoError(t, err)
|
|
assert.NotNil(t, c)
|
|
|
|
b := NewServerBuilder()
|
|
metaKV := etcdkv.NewEtcdKV(c, "test")
|
|
s := sessionutil.NewMockSession(t)
|
|
f := syncutil.NewFuture[types.MixCoordClient]()
|
|
newServer := b.WithETCD(c).
|
|
WithMetaKV(metaKV).
|
|
WithSession(s).
|
|
WithMixCoordClient(f).
|
|
Build()
|
|
|
|
ctx := context.Background()
|
|
err = newServer.Start(ctx)
|
|
assert.NoError(t, err)
|
|
newServer.Stop()
|
|
}
|