From 3267d0208df744ef4c6d4bb453e25f6ed22c56aa Mon Sep 17 00:00:00 2001 From: Congqi Xia Date: Thu, 18 Apr 2024 12:04:09 +0800 Subject: [PATCH] Fix empty search case Signed-off-by: Congqi Xia --- test/testcases/search_test.go | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/test/testcases/search_test.go b/test/testcases/search_test.go index f7021f5a9..46d284f55 100644 --- a/test/testcases/search_test.go +++ b/test/testcases/search_test.go @@ -8,6 +8,7 @@ import ( "testing" "time" + "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" "github.com/milvus-io/milvus-sdk-go/v2/client" @@ -175,7 +176,10 @@ func TestSearchEmptyCollection(t *testing.T) { common.DefaultTopK, sp, ) - require.Len(t, searchRes, 0) + require.Len(t, searchRes, common.DefaultNq) + for _, resultSet := range searchRes { + assert.EqualValues(t, 0, resultSet.ResultCount) + } } } @@ -1151,7 +1155,10 @@ func TestSearchArrayFieldExpr(t *testing.T) { sp, ) common.CheckErr(t, errSearchEmpty, true) - require.Empty(t, searchRes) + require.Len(t, searchRes, common.DefaultNq) + for _, resultSet := range searchRes { + assert.EqualValues(t, 0, resultSet.ResultCount) + } } }