mirror of
https://gitee.com/milvus-io/milvus.git
synced 2024-12-02 11:59:00 +08:00
fix historical unittest (#6705)
Signed-off-by: bigsheeper <yihao.dai@zilliz.com>
This commit is contained in:
parent
384cc06dd1
commit
2f44fc40a3
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user