Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
milvus
milvus
提交
65ce1f97
M
milvus
项目概览
milvus
/
milvus
接近 1 年 前同步成功
通知
261
Star
22476
Fork
2472
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
M
milvus
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
65ce1f97
编写于
12月 07, 2020
作者:
Z
zhenshan.cao
提交者:
yefu.chen
12月 07, 2020
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Fix bug: pulsar dirty msg
Signed-off-by:
N
zhenshan.cao
<
zhenshan.cao@zilliz.com
>
上级
7bbbc146
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
50 addition
and
11 deletion
+50
-11
internal/master/global_allocator_test.go
internal/master/global_allocator_test.go
+0
-11
internal/master/master_test.go
internal/master/master_test.go
+31
-0
internal/proxy/proxy_test.go
internal/proxy/proxy_test.go
+19
-0
未找到文件。
internal/master/global_allocator_test.go
浏览文件 @
65ce1f97
package
master
import
(
"os"
"testing"
"time"
...
...
@@ -12,16 +11,6 @@ import (
var
gTestTsoAllocator
Allocator
var
gTestIDAllocator
*
GlobalIDAllocator
func
TestMain
(
m
*
testing
.
M
)
{
Params
.
Init
()
etcdAddr
:=
Params
.
EtcdAddress
gTestTsoAllocator
=
NewGlobalTSOAllocator
(
"timestamp"
,
tsoutil
.
NewTSOKVBase
([]
string
{
etcdAddr
},
"/test/root/kv"
,
"tso"
))
gTestIDAllocator
=
NewGlobalIDAllocator
(
"idTimestamp"
,
tsoutil
.
NewTSOKVBase
([]
string
{
etcdAddr
},
"/test/root/kv"
,
"gid"
))
exitCode
:=
m
.
Run
()
os
.
Exit
(
exitCode
)
}
func
TestGlobalTSOAllocator_Initialize
(
t
*
testing
.
T
)
{
err
:=
gTestTsoAllocator
.
Initialize
()
assert
.
Nil
(
t
,
err
)
...
...
internal/master/master_test.go
浏览文件 @
65ce1f97
...
...
@@ -4,9 +4,12 @@ import (
"context"
"log"
"math/rand"
"os"
"strconv"
"testing"
"github.com/zilliztech/milvus-distributed/internal/util/tsoutil"
"github.com/golang/protobuf/proto"
"github.com/stretchr/testify/assert"
ms
"github.com/zilliztech/milvus-distributed/internal/msgstream"
...
...
@@ -39,6 +42,23 @@ func makeMasterAddress(port int64) string {
return
masterAddr
}
func
makeNewChannalNames
(
names
[]
string
,
suffix
string
)
[]
string
{
var
ret
[]
string
for
_
,
name
:=
range
names
{
ret
=
append
(
ret
,
name
+
suffix
)
}
return
ret
}
func
refreshChannelNames
()
{
suffix
:=
"_test"
+
strconv
.
FormatInt
(
rand
.
Int63n
(
100
),
10
)
Params
.
DDChannelNames
=
makeNewChannalNames
(
Params
.
DDChannelNames
,
suffix
)
Params
.
WriteNodeTimeTickChannelNames
=
makeNewChannalNames
(
Params
.
WriteNodeTimeTickChannelNames
,
suffix
)
Params
.
InsertChannelNames
=
makeNewChannalNames
(
Params
.
InsertChannelNames
,
suffix
)
Params
.
K2SChannelNames
=
makeNewChannalNames
(
Params
.
K2SChannelNames
,
suffix
)
Params
.
ProxyTimeTickChannelNames
=
makeNewChannalNames
(
Params
.
ProxyTimeTickChannelNames
,
suffix
)
}
func
receiveTimeTickMsg
(
stream
*
ms
.
MsgStream
)
bool
{
for
{
result
:=
(
*
stream
)
.
Consume
()
...
...
@@ -56,6 +76,17 @@ func getTimeTickMsgPack(ttmsgs [][2]uint64) *ms.MsgPack {
return
&
msgPack
}
func
TestMain
(
m
*
testing
.
M
)
{
Init
()
refreshMasterAddress
()
refreshChannelNames
()
etcdAddr
:=
Params
.
EtcdAddress
gTestTsoAllocator
=
NewGlobalTSOAllocator
(
"timestamp"
,
tsoutil
.
NewTSOKVBase
([]
string
{
etcdAddr
},
"/test/root/kv"
,
"tso"
))
gTestIDAllocator
=
NewGlobalIDAllocator
(
"idTimestamp"
,
tsoutil
.
NewTSOKVBase
([]
string
{
etcdAddr
},
"/test/root/kv"
,
"gid"
))
exitCode
:=
m
.
Run
()
os
.
Exit
(
exitCode
)
}
func
TestMaster
(
t
*
testing
.
T
)
{
Init
()
refreshMasterAddress
()
...
...
internal/proxy/proxy_test.go
浏览文件 @
65ce1f97
...
...
@@ -4,6 +4,7 @@ import (
"context"
"fmt"
"log"
"math/rand"
"os"
"strconv"
"strings"
...
...
@@ -34,8 +35,26 @@ var masterServer *master.Master
var
testNum
=
10
func
makeNewChannalNames
(
names
[]
string
,
suffix
string
)
[]
string
{
var
ret
[]
string
for
_
,
name
:=
range
names
{
ret
=
append
(
ret
,
name
+
suffix
)
}
return
ret
}
func
refreshChannelNames
()
{
suffix
:=
"_test"
+
strconv
.
FormatInt
(
rand
.
Int63n
(
100
),
10
)
master
.
Params
.
DDChannelNames
=
makeNewChannalNames
(
master
.
Params
.
DDChannelNames
,
suffix
)
master
.
Params
.
WriteNodeTimeTickChannelNames
=
makeNewChannalNames
(
master
.
Params
.
WriteNodeTimeTickChannelNames
,
suffix
)
master
.
Params
.
InsertChannelNames
=
makeNewChannalNames
(
master
.
Params
.
InsertChannelNames
,
suffix
)
master
.
Params
.
K2SChannelNames
=
makeNewChannalNames
(
master
.
Params
.
K2SChannelNames
,
suffix
)
master
.
Params
.
ProxyTimeTickChannelNames
=
makeNewChannalNames
(
master
.
Params
.
ProxyTimeTickChannelNames
,
suffix
)
}
func
startMaster
(
ctx
context
.
Context
)
{
master
.
Init
()
refreshChannelNames
()
etcdAddr
:=
master
.
Params
.
EtcdAddress
metaRootPath
:=
master
.
Params
.
MetaRootPath
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录