enhance: Add unit test for level-zero segment deltalog request resource (#30718)

See also #30670 #30704

Signed-off-by: Congqi Xia <congqi.xia@zilliz.com>
pull/30757/head
congqixia 2024-02-23 10:00:54 +08:00 committed by GitHub
parent c5363c70db
commit 90e802e441
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 23 additions and 0 deletions

View File

@ -33,6 +33,7 @@ import (
milvus_storage "github.com/milvus-io/milvus-storage/go/storage"
"github.com/milvus-io/milvus-storage/go/storage/options"
"github.com/milvus-io/milvus-storage/go/storage/schema"
"github.com/milvus-io/milvus/internal/proto/datapb"
"github.com/milvus-io/milvus/internal/proto/querypb"
"github.com/milvus-io/milvus/internal/storage"
"github.com/milvus-io/milvus/internal/util/initcore"
@ -782,6 +783,28 @@ func (suite *SegmentLoaderDetailSuite) TestRequestResource() {
_, _, err := suite.loader.requestResource(context.Background())
suite.NoError(err)
})
suite.Run("l0_segment_deltalog", func() {
paramtable.Get().Save(paramtable.Get().QueryNodeCfg.DeltaDataExpansionRate.Key, "50")
defer paramtable.Get().Reset(paramtable.Get().QueryNodeCfg.DeltaDataExpansionRate.Key)
resource, _, err := suite.loader.requestResource(context.Background(), &querypb.SegmentLoadInfo{
SegmentID: 100,
CollectionID: suite.collectionID,
Level: datapb.SegmentLevel_L0,
Deltalogs: []*datapb.FieldBinlog{
{
Binlogs: []*datapb.Binlog{
{LogSize: 10000},
{LogSize: 12000},
},
},
},
})
suite.NoError(err)
suite.EqualValues(1100000, resource.MemorySize)
})
}
func TestSegmentLoader(t *testing.T) {