test: fix property case and remove load default replicaNum value (#41674)

issue: #41673

---------

Signed-off-by: ThreadDao <yufen.zong@zilliz.com>
This commit is contained in:
ThreadDao 2025-05-09 10:14:54 +08:00 committed by GitHub
parent dfd2548c1b
commit caaf9b1ea4
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 13 additions and 6 deletions

View File

@ -84,8 +84,8 @@ func (opt *loadCollectionOption) WithRefresh(isRefresh bool) *loadCollectionOpti
func NewLoadCollectionOption(collectionName string) *loadCollectionOption {
return &loadCollectionOption{
collectionName: collectionName,
replicaNum: 1,
interval: time.Millisecond * 200,
// replicaNum: 1, The default value of the replicaNum should be set on the server side
interval: time.Millisecond * 200,
}
}
@ -156,8 +156,8 @@ func NewLoadPartitionsOption(collectionName string, partitionsNames ...string) *
return &loadPartitionsOption{
collectionName: collectionName,
partitionNames: partitionsNames,
replicaNum: 1,
interval: time.Millisecond * 200,
// replicaNum: 1, The default value of the replicaNum should be set on the server side
interval: time.Millisecond * 200,
}
}

View File

@ -358,8 +358,15 @@ func TestDatabasePropertiesRgReplicas(t *testing.T) {
prepare.FlushData(ctx, t, mc, schema.CollectionName)
prepare.CreateIndex(ctx, t, mc, hp.TNewIndexParams(schema))
_, err = mc.LoadCollection(ctx, client.NewLoadCollectionOption(schema.CollectionName))
common.CheckErr(t, err, true)
// When load does not specify parameters, rg and replica Properties take effect
_, errLoad := mc.LoadCollection(ctx, client.NewLoadCollectionOption(schema.CollectionName))
common.CheckErr(t, errLoad, false, "resource group not found", "service resource insufficient")
// actually load with default rg, rg1 not existed
taskLoad, errLoad := mc.LoadCollection(ctx, client.NewLoadCollectionOption(schema.CollectionName).WithReplica(1))
common.CheckErr(t, errLoad, true)
errLoad = taskLoad.Await(ctx)
common.CheckErr(t, errLoad, true)
_, err = mc.Query(ctx, client.NewQueryOption(schema.CollectionName).WithLimit(10))
common.CheckErr(t, err, true)