未验证 提交 2f44fc40 编写于 作者: B bigsheeper 提交者: GitHub

fix historical unittest (#6705)

Signed-off-by: Nbigsheeper <yihao.dai@zilliz.com>
上级 384cc06d
......@@ -66,13 +66,14 @@ func TestHistorical_GlobalSealedSegments(t *testing.T) {
// watch test
go n.historical.watchGlobalSegmentMeta()
time.Sleep(100 * time.Millisecond) // for etcd latency
segmentInfoStr := proto.MarshalTextString(segmentInfo)
assert.NotNil(t, n.etcdKV)
segmentKey := segmentMetaPrefix + "/" + strconv.FormatInt(segmentID, 10)
err := n.etcdKV.Save(segmentKey, segmentInfoStr)
assert.NoError(t, err)
time.Sleep(500 * time.Millisecond) // for etcd latency
time.Sleep(200 * time.Millisecond) // for etcd latency
segmentIDs = n.historical.getGlobalSegmentIDsByCollectionID(collectionID)
assert.Equal(t, 1, len(segmentIDs))
assert.Equal(t, segmentIDs[0], segmentID)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册