From 9ec458eff2a333e667523a5a54d688e56a23d7ae Mon Sep 17 00:00:00 2001 From: kevindiu Date: Wed, 20 Sep 2023 08:53:12 +0000 Subject: [PATCH] fix test Signed-off-by: kevindiu --- pkg/agent/core/ngt/handler/grpc/handler_test.go | 2 +- pkg/agent/core/ngt/handler/grpc/update_test.go | 7 ++++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/pkg/agent/core/ngt/handler/grpc/handler_test.go b/pkg/agent/core/ngt/handler/grpc/handler_test.go index 71fa62950c3..423ec66b12f 100644 --- a/pkg/agent/core/ngt/handler/grpc/handler_test.go +++ b/pkg/agent/core/ngt/handler/grpc/handler_test.go @@ -66,7 +66,7 @@ func newIndexedNGTService(ctx context.Context, eg errgroup.Group, t request.Obje // insert and create index for _, req := range reqs.GetRequests() { - err := ngt.InsertWithTime(req.GetVector().GetId(), req.GetVector().GetVector(), req.GetVector().GetTimestamp()) + err := ngt.InsertWithTime(req.GetVector().GetId(), req.GetVector().GetVector(), insertCfg.GetTimestamp()) if err != nil { return nil, err } diff --git a/pkg/agent/core/ngt/handler/grpc/update_test.go b/pkg/agent/core/ngt/handler/grpc/update_test.go index f1666abffa0..4df09a9a3c7 100644 --- a/pkg/agent/core/ngt/handler/grpc/update_test.go +++ b/pkg/agent/core/ngt/handler/grpc/update_test.go @@ -849,11 +849,11 @@ func Test_server_Update(t *testing.T) { req: &payload.Update_Request{ Vector: &payload.Object_Vector{ - Id: indexID, - Vector: indexVector, - Timestamp: newTS.UnixNano(), + Id: indexID, + Vector: indexVector, }, Config: &payload.Update_Config{ + Timestamp: newTS.UnixNano(), SkipStrictExistCheck: false, UpdateTimestampIfExists: true, }, @@ -866,6 +866,7 @@ func Test_server_Update(t *testing.T) { if err := defaultCheckFunc(w, o, s, err); err != nil { return err } + ov, err := s.GetObject(context.Background(), &payload.Object_VectorRequest{ Id: &payload.Object_ID{ Id: indexID,