mirror of https://github.com/milvus-io/milvus.git
Fix master branch unittest error (#7083)
Resolves: #7080 Signed-off-by: yangxuan <xuan.yang@zilliz.com>pull/7087/head
parent
6c5be83ea1
commit
86ca96a02e
|
@ -320,11 +320,11 @@ func (node *DataNode) Start() error {
|
|||
}
|
||||
|
||||
connectEtcdFn := func() error {
|
||||
etcdClient, err := clientv3.New(clientv3.Config{Endpoints: Params.EtcdEndpoints})
|
||||
etcdKV, err := etcdkv.NewEtcdKV(Params.EtcdEndpoints, Params.MetaRootPath)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
node.kvClient = etcdkv.NewEtcdKV(etcdClient, Params.MetaRootPath)
|
||||
node.kvClient = etcdKV
|
||||
return nil
|
||||
}
|
||||
err = retry.Do(node.ctx, connectEtcdFn, retry.Attempts(ConnectEtcdMaxRetryTime))
|
||||
|
|
|
@ -24,7 +24,6 @@ import (
|
|||
"github.com/golang/protobuf/proto"
|
||||
"github.com/stretchr/testify/assert"
|
||||
"github.com/stretchr/testify/require"
|
||||
"go.etcd.io/etcd/clientv3"
|
||||
"go.uber.org/zap"
|
||||
|
||||
etcdkv "github.com/milvus-io/milvus/internal/kv/etcd"
|
||||
|
@ -333,11 +332,9 @@ func TestWatchChannel(t *testing.T) {
|
|||
defer cancel()
|
||||
|
||||
t.Run("test watch channel", func(t *testing.T) {
|
||||
client, err := clientv3.New(clientv3.Config{Endpoints: Params.EtcdEndpoints})
|
||||
assert.Nil(t, err)
|
||||
if assert.NotNil(t, client) {
|
||||
|
||||
kv := etcdkv.NewEtcdKV(client, Params.MetaRootPath)
|
||||
kv, err := etcdkv.NewEtcdKV(Params.EtcdEndpoints, Params.MetaRootPath)
|
||||
require.NoError(t, err)
|
||||
ch := fmt.Sprintf("datanode-etcd-test-channel_%d", rand.Int31())
|
||||
path := fmt.Sprintf("channel/%d/%s", node.NodeID, ch)
|
||||
c := make(chan struct{})
|
||||
|
@ -386,6 +383,5 @@ func TestWatchChannel(t *testing.T) {
|
|||
_, has = node.vchan2SyncService[ch]
|
||||
node.chanMut.RUnlock()
|
||||
assert.False(t, has)
|
||||
}
|
||||
})
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue