Skip to content

Commit

Permalink
Use get load state to check async load task
Browse files Browse the repository at this point in the history
Signed-off-by: Congqi Xia <[email protected]>
  • Loading branch information
congqixia committed Dec 11, 2024
1 parent cecc6ef commit 6b9a564
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 8 deletions.
1 change: 0 additions & 1 deletion client/partition.go
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,6 @@ func (c *GrpcClient) ShowPartitions(ctx context.Context, collName string) ([]*en
req := &milvuspb.ShowPartitionsRequest{
DbName: "", // reserved
CollectionName: collName,
Type: milvuspb.ShowType_InMemory,
}
resp, err := c.Service.ShowPartitions(ctx, req)
if err != nil {
Expand Down
12 changes: 5 additions & 7 deletions test/testcases/load_release_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -318,13 +318,11 @@ func TestLoadPartitionsAsync(t *testing.T) {
time.Sleep(time.Second * 5)

// check partition loaded
partitions, errShow := mc.ShowPartitions(ctx, collName)
if errShow == nil {
for _, p := range partitions {
log.Printf("id: %d, name: %s, loaded %t", p.ID, p.Name, p.Loaded)
if p.Name == partitionName && p.Loaded {
return
}
state, err := mc.GetLoadState(ctx, collName, []string{partitionName})
// partitions, errShow := mc.ShowPartitions(ctx, collName)
if err == nil {
if state == entity.LoadStateLoaded {
return
}
} else {
t.FailNow()
Expand Down

0 comments on commit 6b9a564

Please sign in to comment.