mirror of
https://gitee.com/milvus-io/milvus.git
synced 2026-01-07 19:31:51 +08:00
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:
parent
dfd2548c1b
commit
caaf9b1ea4
@ -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,
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -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)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user