未验证 提交 96fd7e93 编写于 作者: G groot 提交者: GitHub

Reduce go unittest time cost (#8492)

Signed-off-by: Nyhmo <yihua.mo@zilliz.com>
上级 7a76022f
......@@ -344,7 +344,7 @@ func TestLoadBalanceTask(t *testing.T) {
queryNode2, err := startQueryNodeServer(baseCtx)
assert.Nil(t, err)
time.Sleep(time.Second)
time.Sleep(100 * time.Millisecond)
res, err := queryCoord.LoadCollection(baseCtx, &querypb.LoadCollectionRequest{
Base: &commonpb.MsgBase{
MsgType: commonpb.MsgType_LoadCollection,
......@@ -355,7 +355,7 @@ func TestLoadBalanceTask(t *testing.T) {
assert.Nil(t, err)
assert.Equal(t, commonpb.ErrorCode_Success, res.ErrorCode)
time.Sleep(time.Second)
time.Sleep(100 * time.Millisecond)
for {
collectionInfo := queryCoord.meta.showCollections()
if collectionInfo[0].InMemoryPercentage == 100 {
......
......@@ -70,7 +70,7 @@ func waitAllQueryNodeOffline(cluster Cluster, nodes map[int64]Node) bool {
return true
}
log.Debug("wait all queryNode offline")
time.Sleep(time.Second)
time.Sleep(100 * time.Millisecond)
reDoCount--
}
}
......@@ -88,7 +88,7 @@ func TestQueryNode_MultiNode_stop(t *testing.T) {
queryNode5, err := startQueryNodeServer(baseCtx)
assert.Nil(t, err)
time.Sleep(2 * time.Second)
time.Sleep(100 * time.Millisecond)
queryNode1.stop()
err = removeNodeSession(queryNode1.queryNodeID)
assert.Nil(t, err)
......@@ -100,7 +100,7 @@ func TestQueryNode_MultiNode_stop(t *testing.T) {
CollectionID: defaultCollectionID,
Schema: genCollectionSchema(defaultCollectionID, false),
})
time.Sleep(2 * time.Second)
time.Sleep(100 * time.Millisecond)
_, err = queryCoord.ReleaseCollection(baseCtx, &querypb.ReleaseCollectionRequest{
Base: &commonpb.MsgBase{
MsgType: commonpb.MsgType_ReleaseCollection,
......@@ -108,7 +108,7 @@ func TestQueryNode_MultiNode_stop(t *testing.T) {
CollectionID: defaultCollectionID,
})
assert.Nil(t, err)
time.Sleep(2 * time.Second)
time.Sleep(100 * time.Millisecond)
nodes, err := queryCoord.cluster.onlineNodes()
assert.Nil(t, err)
queryNode5.stop()
......@@ -132,7 +132,7 @@ func TestQueryNode_MultiNode_reStart(t *testing.T) {
queryNode1, err := startQueryNodeServer(baseCtx)
assert.Nil(t, err)
time.Sleep(2 * time.Second)
time.Sleep(100 * time.Millisecond)
queryCoord.LoadCollection(baseCtx, &querypb.LoadCollectionRequest{
Base: &commonpb.MsgBase{
MsgType: commonpb.MsgType_LoadCollection,
......@@ -146,7 +146,7 @@ func TestQueryNode_MultiNode_reStart(t *testing.T) {
queryNode3, err := startQueryNodeServer(baseCtx)
assert.Nil(t, err)
time.Sleep(2 * time.Second)
time.Sleep(100 * time.Millisecond)
_, err = queryCoord.ReleaseCollection(baseCtx, &querypb.ReleaseCollectionRequest{
Base: &commonpb.MsgBase{
MsgType: commonpb.MsgType_ReleaseCollection,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册