From ba9952e780958a1c8063e630dda2c49744ffb91b Mon Sep 17 00:00:00 2001 From: sunby Date: Fri, 11 Jun 2021 16:09:05 +0800 Subject: [PATCH] Fix unit test in dataservice (#5745) After a unit test, the msg stream will be closed. But in pulsar go client, the connection between client and server will be reconnected. Then we rebuild the msgstream immediately and produce a message, this message will be sent to the previous connection which cause timeout of test. We append the channelName wil a random value. Signed-off-by: sunby --- internal/dataservice/server_test.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/internal/dataservice/server_test.go b/internal/dataservice/server_test.go index 4b87ced64a..e0875082d0 100644 --- a/internal/dataservice/server_test.go +++ b/internal/dataservice/server_test.go @@ -13,9 +13,12 @@ import ( "context" "math" "path" + "strconv" "testing" "time" + "math/rand" + "github.com/milvus-io/milvus/internal/msgstream" "github.com/milvus-io/milvus/internal/proto/commonpb" "github.com/milvus-io/milvus/internal/proto/datapb" @@ -831,6 +834,8 @@ func TestGetRecoveryInfo(t *testing.T) { func newTestServer(t *testing.T, receiveCh chan interface{}) *Server { Params.Init() + Params.TimeTickChannelName += strconv.Itoa(rand.Int()) + Params.StatisticsChannelName += strconv.Itoa(rand.Int()) var err error factory := msgstream.NewPmsFactory() m := map[string]interface{}{