Skip to content

Commit

Permalink
fix: ut
Browse files Browse the repository at this point in the history
Signed-off-by: chyezh <[email protected]>
  • Loading branch information
chyezh committed Jan 2, 2025
1 parent c02f243 commit c7b94ca
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions tests/go_client/testcases/delete_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@ package testcases

import (
"fmt"
"sync"
"testing"
"time"

"github.com/remeh/sizedwaitgroup"
"github.com/stretchr/testify/require"
"go.uber.org/zap"

Expand Down Expand Up @@ -477,9 +477,13 @@ func TestDeleteComplexExpr(t *testing.T) {
{expr: fmt.Sprintf("%s == [0, 1]", common.DefaultDoubleArrayField), count: 0}, // array ==
{expr: fmt.Sprintf("array_length(%s) == %d", common.DefaultDoubleArrayField, capacity), count: common.DefaultNb}, // array_length
}
sizedwaitgroup := sizedwaitgroup.New(5)
ch := make(chan struct{}, 5)
wg := sync.WaitGroup{}
testFunc := func(exprLimit exprCount) {
defer sizedwaitgroup.Done()
defer func() {
wg.Done()
<-ch
}()
ctx := hp.CreateContext(t, time.Second*common.DefaultTimeout*2)
mc := createDefaultMilvusClient(ctx, t)

Expand Down Expand Up @@ -509,10 +513,11 @@ func TestDeleteComplexExpr(t *testing.T) {

for _, exprLimit := range exprLimits {
exprLimit := exprLimit
sizedwaitgroup.Add()
ch <- struct{}{}
wg.Add(1)
go testFunc(exprLimit)
}
sizedwaitgroup.Wait()
wg.Wait()
}

func TestDeleteInvalidExpr(t *testing.T) {
Expand Down

0 comments on commit c7b94ca

Please sign in to comment.