From e6450b0d96594a71e5b943f170eef91e7ca40145 Mon Sep 17 00:00:00 2001 From: groot Date: Thu, 16 Sep 2021 12:31:53 +0800 Subject: [PATCH] Add unittest for distributed indexnode (#7991) Signed-off-by: yhmo --- .../distributed/indexnode/client/paramtable_test.go | 10 ++++++++++ internal/distributed/indexnode/paramtable_test.go | 10 ++++++++++ 2 files changed, 20 insertions(+) diff --git a/internal/distributed/indexnode/client/paramtable_test.go b/internal/distributed/indexnode/client/paramtable_test.go index 547a2e498..50a386d4b 100644 --- a/internal/distributed/indexnode/client/paramtable_test.go +++ b/internal/distributed/indexnode/client/paramtable_test.go @@ -14,7 +14,9 @@ package grpcindexnodeclient import ( "testing" + "github.com/milvus-io/milvus/internal/distributed/grpcconfigs" "github.com/milvus-io/milvus/internal/log" + "github.com/stretchr/testify/assert" "go.uber.org/zap" ) @@ -23,4 +25,12 @@ func TestParamTable(t *testing.T) { log.Info("TestParamTable", zap.Int("ClientMaxSendSize", Params.ClientMaxSendSize)) log.Info("TestParamTable", zap.Int("ClientMaxRecvSize", Params.ClientMaxRecvSize)) + + Params.Remove("indexNode.grpc.clientMaxSendSize") + Params.initClientMaxSendSize() + assert.Equal(t, Params.ClientMaxSendSize, grpcconfigs.DefaultClientMaxSendSize) + + Params.Remove("indexNode.grpc.clientMaxRecvSize") + Params.initClientMaxRecvSize() + assert.Equal(t, Params.ClientMaxRecvSize, grpcconfigs.DefaultClientMaxRecvSize) } diff --git a/internal/distributed/indexnode/paramtable_test.go b/internal/distributed/indexnode/paramtable_test.go index a84b53254..d2c511ea9 100644 --- a/internal/distributed/indexnode/paramtable_test.go +++ b/internal/distributed/indexnode/paramtable_test.go @@ -14,7 +14,9 @@ package grpcindexnode import ( "testing" + "github.com/milvus-io/milvus/internal/distributed/grpcconfigs" "github.com/milvus-io/milvus/internal/log" + "github.com/stretchr/testify/assert" "go.uber.org/zap" ) @@ -23,4 +25,12 @@ func TestParamTable(t *testing.T) { log.Info("TestParamTable", zap.Int("ServerMaxSendSize", Params.ServerMaxSendSize)) log.Info("TestParamTable", zap.Int("ServerMaxRecvSize", Params.ServerMaxRecvSize)) + + Params.Remove("indexNode.grpc.ServerMaxSendSize") + Params.initServerMaxSendSize() + assert.Equal(t, Params.ServerMaxSendSize, grpcconfigs.DefaultServerMaxSendSize) + + Params.Remove("indexNode.grpc.ServerMaxRecvSize") + Params.initServerMaxRecvSize() + assert.Equal(t, Params.ServerMaxRecvSize, grpcconfigs.DefaultServerMaxRecvSize) } -- GitLab