Skip to content

Commit

Permalink
enhance: [skip e2e] add alter collection task ut (milvus-io#30447)
Browse files Browse the repository at this point in the history
Signed-off-by: sunby <[email protected]>
  • Loading branch information
sunby authored Feb 2, 2024
1 parent 3b58670 commit dcdf859
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions internal/proxy/task_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3597,3 +3597,22 @@ func TestClusteringKey(t *testing.T) {
assert.Error(t, err)
})
}

func TestAlterCollectionCheckLoaded(t *testing.T) {
qc := &mocks.MockQueryCoordClient{}
qc.EXPECT().ShowCollections(mock.Anything, mock.Anything).Return(&querypb.ShowCollectionsResponse{
Status: &commonpb.Status{ErrorCode: commonpb.ErrorCode_Success},
CollectionIDs: []int64{1},
InMemoryPercentages: []int64{100},
}, nil)
task := &alterCollectionTask{
AlterCollectionRequest: &milvuspb.AlterCollectionRequest{
Base: &commonpb.MsgBase{},
CollectionID: 1,
Properties: []*commonpb.KeyValuePair{{Key: common.MmapEnabledKey, Value: "true"}},
},
queryCoord: qc,
}
err := task.PreExecute(context.Background())
assert.Equal(t, merr.Code(merr.ErrCollectionLoaded), merr.Code(err))
}

0 comments on commit dcdf859

Please sign in to comment.