Fix data race in test (#15690)

Signed-off-by: sunby <bingyi.sun@zilliz.com>

Co-authored-by: sunby <bingyi.sun@zilliz.com>
pull/15694/head v2.0.1
Bingyi Sun 2022-02-22 17:43:52 +08:00 committed by GitHub
parent f2017043a3
commit ce9662c140
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 10 additions and 3 deletions

View File

@ -910,11 +910,18 @@ func Test_RepeatedLoadDifferentPartitions(t *testing.T) {
status, err := queryCoord.LoadPartitions(ctx, loadPartitionReq)
assert.Equal(t, commonpb.ErrorCode_Success, status.ErrorCode)
assert.Nil(t, err)
waitLoadPartitionDone(ctx, queryCoord, defaultCollectionID, []UniqueID{defaultPartitionID})
assert.Nil(t, waitLoadPartitionDone(ctx, queryCoord, defaultCollectionID, []UniqueID{defaultPartitionID}))
// second load defaultPartitionID+1
loadPartitionReq.PartitionIDs = []UniqueID{defaultPartitionID + 1}
status, err = queryCoord.LoadPartitions(ctx, loadPartitionReq)
failLoadRequest := &querypb.LoadPartitionsRequest{
Base: &commonpb.MsgBase{
MsgType: commonpb.MsgType_LoadPartitions,
},
CollectionID: defaultCollectionID,
PartitionIDs: []UniqueID{defaultPartitionID + 1},
Schema: genDefaultCollectionSchema(false),
}
status, err = queryCoord.LoadPartitions(ctx, failLoadRequest)
assert.Equal(t, commonpb.ErrorCode_UnexpectedError, status.ErrorCode)
assert.Nil(t, err)