Fix wrong unittest, check whether loading collection will cause OOM (#16068)

Signed-off-by: yah01 <yang.cen@zilliz.com>
pull/16068/merge
yah01 2022-03-18 13:17:22 +08:00 committed by GitHub
parent 78557ca6d7
commit 31c5b286da
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 0 deletions

View File

@ -634,10 +634,16 @@ func TestTask_loadSegmentsTask(t *testing.T) {
PartitionID: defaultPartitionID,
CollectionID: defaultCollectionID,
NumOfRows: totalRAM / int64(sizePerRecord),
SegmentSize: totalRAM,
},
}
// Reach the segment size that would cause OOM
for node.loader.checkSegmentSize(defaultCollectionID, task.req.Infos, 1) == nil {
task.req.Infos[0].SegmentSize *= 2
}
err = task.Execute(ctx)
assert.Error(t, err)
assert.Contains(t, err.Error(), "OOM")
})
}