Skip to content
Snippets Groups Projects
Commit 48e3abf6 authored by scott.wang's avatar scott.wang
Browse files

Fix merge from local branch

parents 1e91d2a9 069d5fe6
No related branches found
No related tags found
No related merge requests found
......@@ -70,7 +70,7 @@ func (l *configurationListener) Next() (*registry.ServiceEvent, error) {
return nil, perrors.New("listener stopped")
case e := <-l.events:
logger.Infof("got etcd event %#s", e)
logger.Infof("got etcd event %#v", e)
if e.ConfigType == remoting.EventTypeDel {
select {
case <-l.registry.done:
......
package etcdv3
import (
"context"
"sync"
"time"
)
import (
"github.com/apache/dubbo-go/common"
)
type mockFacade struct {
client *Client
cltLock sync.Mutex
wg sync.WaitGroup
URL *common.URL
done chan struct{}
}
func (r *mockFacade) Client() *Client {
return r.client
}
func (r *mockFacade) SetClient(client *Client) {
r.client = client
}
func (r *mockFacade) ClientLock() *sync.Mutex {
return &r.cltLock
}
func (r *mockFacade) WaitGroup() *sync.WaitGroup {
return &r.wg
}
func (r *mockFacade) GetDone() chan struct{} {
return r.done
}
func (r *mockFacade) GetUrl() common.URL {
return *r.URL
}
func (r *mockFacade) Destroy() {
close(r.done)
r.wg.Wait()
}
func (r *mockFacade) RestartCallBack() bool {
return true
}
func (r *mockFacade) IsAvailable() bool {
return true
}
func (suite *ClientTestSuite) TestFacade() {
c := suite.client
t := suite.T()
url, err := common.NewURL(context.Background(), "mock://127.0.0.1:2379")
if err != nil {
t.Fatal(err)
}
mock := &mockFacade{client: c, URL: &url}
go HandleClientRestart(mock)
c.Close()
time.Sleep(2 * time.Second)
}
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment