From d927718e95a81f680a6d75d49adf7e75df883015 Mon Sep 17 00:00:00 2001 From: congqixia Date: Mon, 18 Mar 2024 17:36:59 +0800 Subject: [PATCH] fix: Load collection before delete by expr (#677) See also #674 Signed-off-by: Congqi Xia --- test/testcases/delete_test.go | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/test/testcases/delete_test.go b/test/testcases/delete_test.go index d5094da1..afed4c9c 100644 --- a/test/testcases/delete_test.go +++ b/test/testcases/delete_test.go @@ -351,7 +351,6 @@ func TestDeleteExpressions(t *testing.T) { } func TestDeleteInvalidExpr(t *testing.T) { - t.Skip("invalid error message like failed to create expr plan or collection not loaded") t.Parallel() ctx := createContext(t, time.Second*common.DefaultTimeout) // connect @@ -379,8 +378,14 @@ func TestDeleteInvalidExpr(t *testing.T) { } _, _ = insertData(ctx, t, mc, dp) - err := mc.Delete(ctx, collName, "", "") - common.CheckErr(t, err, false, "invalid expression: expected=valid expr, actual=empty expr: invalid parameter") + idx, _ := entity.NewIndexHNSW(entity.L2, 8, 96) + _ = mc.CreateIndex(ctx, collName, common.DefaultFloatVecFieldName, idx, false) + + err := mc.LoadCollection(ctx, collName, false) + common.CheckErr(t, err, true, "") + + err = mc.Delete(ctx, collName, "", "") + common.CheckErr(t, err, false, "invalid expression") for _, _invalidExprs := range common.InvalidExpressions { err := mc.Delete(ctx, collName, "", _invalidExprs.Expr)