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 <bingyi.sun@zilliz.com>
pull/5779/head
sunby 2021-06-11 16:09:05 +08:00 committed by zhenshan.cao
parent 89c0acd8b8
commit ba9952e780
1 changed files with 5 additions and 0 deletions

View File

@ -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{}{