chore: add more tests (#3014)
This commit is contained in:
@@ -2,7 +2,6 @@ package clientinterceptors
|
||||
|
||||
import (
|
||||
"context"
|
||||
"github.com/zeromicro/go-zero/core/lang"
|
||||
"io"
|
||||
|
||||
ztrace "github.com/zeromicro/go-zero/core/trace"
|
||||
@@ -95,7 +94,7 @@ type (
|
||||
Finished chan error
|
||||
desc *grpc.StreamDesc
|
||||
events chan streamEvent
|
||||
eventsDone chan lang.PlaceholderType
|
||||
eventsDone chan struct{}
|
||||
receivedMessageID int
|
||||
sentMessageID int
|
||||
}
|
||||
|
||||
@@ -26,8 +26,8 @@ func NewRpcPubServer(etcd discov.EtcdConf, listenOn string, middlewares ServerMi
|
||||
pubOpts = append(pubOpts, discov.WithPubEtcdTLS(etcd.CertFile, etcd.CertKeyFile,
|
||||
etcd.CACertFile, etcd.InsecureSkipVerify))
|
||||
}
|
||||
if etcd.HasServerID() {
|
||||
pubOpts = append(pubOpts, discov.WithId(etcd.ServerID))
|
||||
if etcd.HasID() {
|
||||
pubOpts = append(pubOpts, discov.WithId(etcd.ID))
|
||||
}
|
||||
pubClient := discov.NewPublisher(etcd.Hosts, etcd.Key, pubListenOn, pubOpts...)
|
||||
return pubClient.KeepAlive()
|
||||
|
||||
@@ -12,6 +12,7 @@ func TestNewRpcPubServer(t *testing.T) {
|
||||
s, err := NewRpcPubServer(discov.EtcdConf{
|
||||
User: "user",
|
||||
Pass: "pass",
|
||||
ID: 10,
|
||||
}, "", ServerMiddlewaresConf{})
|
||||
assert.NoError(t, err)
|
||||
assert.NotPanics(t, func() {
|
||||
|
||||
Reference in New Issue
Block a user