diff --git a/internal/querynode/meta_service_test.go b/internal/querynode/meta_service_test.go index 46e7811da4b89cbbe5c4d54edc469a842971aefa..63d8d92c1bce80157673c87ed374c8688036b5e9 100644 --- a/internal/querynode/meta_service_test.go +++ b/internal/querynode/meta_service_test.go @@ -42,24 +42,24 @@ func TestMetaService_getSegmentObjId(t *testing.T) { } func TestMetaService_isCollectionObj(t *testing.T) { - var key = "by-dev/meta/collection/collection0" + var key = Params.MetaRootPath + "/collection/collection0" var b1 = isCollectionObj(key) assert.Equal(t, b1, true) - key = "by-dev/meta/segment/segment0" + key = Params.MetaRootPath + "/segment/segment0" var b2 = isCollectionObj(key) assert.Equal(t, b2, false) } func TestMetaService_isSegmentObj(t *testing.T) { - var key = "by-dev/meta/segment/segment0" + var key = Params.MetaRootPath + "/segment/segment0" var b1 = isSegmentObj(key) assert.Equal(t, b1, true) - key = "by-dev/meta/collection/collection0" + key = Params.MetaRootPath + "/collection/collection0" var b2 = isSegmentObj(key) assert.Equal(t, b2, false) @@ -186,7 +186,7 @@ func TestMetaService_processCreate(t *testing.T) { node := newQueryNode() node.metaService = newMetaService(node.queryNodeLoopCtx, node.replica) - key1 := "by-dev/meta/collection/0" + key1 := Params.MetaRootPath + "/collection/0" msg1 := `schema: < name: "test" fields: < @@ -222,7 +222,7 @@ func TestMetaService_processCreate(t *testing.T) { assert.NoError(t, err) assert.Equal(t, collection.ID(), UniqueID(0)) - key2 := "by-dev/meta/segment/0" + key2 := Params.MetaRootPath + "/segment/0" msg2 := `partition_tag: "default" channel_start: 0 channel_end: 1 @@ -378,7 +378,7 @@ func TestMetaService_processModify(t *testing.T) { node := newQueryNode() node.metaService = newMetaService(node.queryNodeLoopCtx, node.replica) - key1 := "by-dev/meta/collection/0" + key1 := Params.MetaRootPath + "/collection/0" msg1 := `schema: < name: "test" fields: < @@ -429,7 +429,7 @@ func TestMetaService_processModify(t *testing.T) { hasPartition = node.replica.hasPartition(UniqueID(0), "p3") assert.Equal(t, hasPartition, false) - key2 := "by-dev/meta/segment/0" + key2 := Params.MetaRootPath + "/segment/0" msg2 := `partition_tag: "p1" channel_start: 0 channel_end: 1 @@ -578,7 +578,7 @@ func TestMetaService_processDelete(t *testing.T) { node := newQueryNode() node.metaService = newMetaService(node.queryNodeLoopCtx, node.replica) - key1 := "by-dev/meta/collection/0" + key1 := Params.MetaRootPath + "/collection/0" msg1 := `schema: < name: "test" fields: < @@ -614,7 +614,7 @@ func TestMetaService_processDelete(t *testing.T) { assert.NoError(t, err) assert.Equal(t, collection.ID(), UniqueID(0)) - key2 := "by-dev/meta/segment/0" + key2 := Params.MetaRootPath + "/segment/0" msg2 := `partition_tag: "default" channel_start: 0 channel_end: 1 diff --git a/internal/querynode/param_table_test.go b/internal/querynode/param_table_test.go index fe74104ac705461baa483bf6098cae53ab3ce0a7..8d77bcd0460478d3b1e3426a7f353733cce9e82c 100644 --- a/internal/querynode/param_table_test.go +++ b/internal/querynode/param_table_test.go @@ -117,7 +117,7 @@ func TestParamTable_statsChannelName(t *testing.T) { func TestParamTable_metaRootPath(t *testing.T) { path := Params.MetaRootPath - assert.Equal(t, "by-dev/meta", path) + fmt.Println(path) } func TestParamTable_ddChannelName(t *testing.T) { diff --git a/internal/querynode/query_node_test.go b/internal/querynode/query_node_test.go index 49ee58138a57fa35edadc860dee04600e201f1f7..3bdce39e27b790e1881eca03be154f7a44900c75 100644 --- a/internal/querynode/query_node_test.go +++ b/internal/querynode/query_node_test.go @@ -21,6 +21,7 @@ const closeWithDeadline = true func setup() { Params.Init() + Params.MetaRootPath = "/etcd/test/root/querynode" } func genTestCollectionMeta(collectionName string, collectionID UniqueID) *etcdpb.CollectionMeta { diff --git a/internal/writenode/meta_table_test.go b/internal/writenode/meta_table_test.go index 451b8a1fd01de2324a162db00b07578dc06e3beb..3d15b09f7a3411ebee288a7bf791b6b44c0830df 100644 --- a/internal/writenode/meta_table_test.go +++ b/internal/writenode/meta_table_test.go @@ -13,9 +13,9 @@ func createMetaTable(t *testing.T) *metaTable { etcdAddr := Params.EtcdAddress cli, err := clientv3.New(clientv3.Config{Endpoints: []string{etcdAddr}}) assert.Nil(t, err) - etcdKV := etcdkv.NewEtcdKV(cli, "/etcd/test/root") + etcdKV := etcdkv.NewEtcdKV(cli, "/etcd/test/root/writer") - _, err = cli.Delete(context.TODO(), "/etcd/test/root", clientv3.WithPrefix()) + _, err = cli.Delete(context.TODO(), "/etcd/test/root/writer", clientv3.WithPrefix()) assert.Nil(t, err) meta, err := NewMetaTable(etcdKV)