From 1fd0e79addfc730e1f658d9ce3270cac2e656fa9 Mon Sep 17 00:00:00 2001 From: groot Date: Thu, 16 Sep 2021 14:17:49 +0800 Subject: [PATCH] Add unittest for distributed datacoord (#7982) Signed-off-by: yhmo --- .../distributed/datacoord/client/paramtable_test.go | 10 ++++++++++ internal/distributed/datacoord/paramtable_test.go | 9 +++++++++ 2 files changed, 19 insertions(+) diff --git a/internal/distributed/datacoord/client/paramtable_test.go b/internal/distributed/datacoord/client/paramtable_test.go index f3e131fdd4..32b4a2fb70 100644 --- a/internal/distributed/datacoord/client/paramtable_test.go +++ b/internal/distributed/datacoord/client/paramtable_test.go @@ -14,7 +14,9 @@ package grpcdatacoordclient 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("dataCoord.grpc.clientMaxSendSize") + Params.initClientMaxSendSize() + assert.Equal(t, Params.ClientMaxSendSize, grpcconfigs.DefaultClientMaxSendSize) + + Params.Remove("dataCoord.grpc.clientMaxRecvSize") + Params.initClientMaxRecvSize() + assert.Equal(t, Params.ClientMaxRecvSize, grpcconfigs.DefaultClientMaxRecvSize) } diff --git a/internal/distributed/datacoord/paramtable_test.go b/internal/distributed/datacoord/paramtable_test.go index c093d96f0d..940b17cb77 100644 --- a/internal/distributed/datacoord/paramtable_test.go +++ b/internal/distributed/datacoord/paramtable_test.go @@ -14,6 +14,7 @@ package grpcdatacoordclient import ( "testing" + "github.com/milvus-io/milvus/internal/distributed/grpcconfigs" "github.com/milvus-io/milvus/internal/log" "go.uber.org/zap" @@ -31,4 +32,12 @@ func TestParamTable(t *testing.T) { log.Info("TestParamTable", zap.Int("ServerMaxSendSize", Params.ServerMaxSendSize)) log.Info("TestParamTable", zap.Int("ServerMaxRecvSize", Params.ServerMaxRecvSize)) + + Params.Remove("dataCoord.grpc.ServerMaxSendSize") + Params.initServerMaxSendSize() + assert.Equal(t, Params.ServerMaxSendSize, grpcconfigs.DefaultServerMaxSendSize) + + Params.Remove("dataCoord.grpc.ServerMaxRecvSize") + Params.initServerMaxRecvSize() + assert.Equal(t, Params.ServerMaxRecvSize, grpcconfigs.DefaultServerMaxRecvSize) }